This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing.
This Lua module is used on approximately 175,000 pages. To avoid major disruption and server load, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them.
{{if in category| [category] | [result if true] | [result if false] | page = [page] }}
If |page= is omitted, the current page is used. If both the second and third unnamed parameters are omitted, the second unnamed parameter defaults to yes.
localp={}functionp.main(frame)localargs=require('Module:Arguments').getArgs(frame)returnp._main(args)endfunctionp._main(args)-- create a title objectlocalpage=(args.pageandmw.title.new(args.page))ormw.title.getCurrentTitle()ifrequire('Module:TableTools').inArray(page.categories,string.gsub(args[1],'^[Cc]ategory:',''))thenifnotargs[3]then-- if we are are not given anything to return, return 'yes' if it evalulates to truereturnargs[2]or'yes'elsereturnargs[2]endelsereturnargs[3]endendreturnp