This is an old revision of this page, as edited by Nihiltres(talk | contribs) at 19:33, 21 July 2018(Moved "unusual parameters" categorization back in for exclusively the exact "other uses" match). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.Revision as of 19:33, 21 July 2018 by Nihiltres(talk | contribs)(Moved "unusual parameters" categorization back in for exclusively the exact "other uses" match)
This Lua module is used on approximately 204,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.
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 module depends on the following other modules:
localmArguments--initialize lazilylocalmHatlist=require('Module:Hatnote list')localmHatnote=require('Module:Hatnote')localp={}--Implements {{For}} from the frame--uses capitalized "For" to avoid collision with Lua reserved word "for"functionp.For(frame)mArguments=require('Module:Arguments')returnp._For(mArguments.getArgs(frame))end--Implements {{For}} but takes a manual arguments tablefunctionp._For(args)localuse=args[1]if(notuse)thenreturnmHatnote.makeWikitextError('no context parameter provided. Use {{other uses}} for "other uses" hatnotes.','Template:For#Errors',args.category)endlocalpages={}functiontwo(a,b)returna,b,1end--lets us run ipairs from 2fork,vintwo(ipairs(args))dotable.insert(pages,v)endreturnmHatnote._hatnote(mHatlist.forSeeTableToString({{use=use,pages=pages}}),{selfref=args.selfref})..((use=='other uses')and'[[Category:Hatnote templates with unusual parameters]]'or'')endreturnp