This Lua module is used on 153,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 subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.
This module depends on the following other modules:
This module implements the {{about}} hatnote template.
Usage
The about function implements the {{about}} template directly, using the frame and applying no options. This should probably only be used in {{about}}.
The _about function can be used from Lua to supply a custom arguments list (its first argument) and/or an options table (its second argument). Options include:
aboutForm A string that can be used to substitute the form of the initial "about" message. It should include two substitution points: the first for the page type (e.g. "article"), and the second for the description of what the page is about. It should also include a trailing space for easy concatenation or omission. Defaults to 'This %s is about %s. '.
sectionString Gives the page type string for when the named argument section is specified. Defaults to 'section'.
localmArguments--initialize lazilylocalmHatnote=require('Module:Hatnote')localmHatList=require('Module:Hatnote list')locallibraryUtil=require('libraryUtil')localcheckType=libraryUtil.checkTypelocalp={}functionp.about(frame)-- A passthrough that gets args from the frame and allmArguments=require('Module:Arguments')args=mArguments.getArgs(frame)returnp._about(args)endfunctionp._about(args,options)-- Produces "about" hatnote.-- Type checks and defaultscheckType('_about',1,args,'table',true)args=argsor{}checkType('_about',2,options,'table',true)options=optionsor{}localdefaultOptions={aboutForm='This %s is about %s. ',PageType=require('Module:Pagetype').main(),otherText=nil,--included for complete listsectionString='section'}fork,vinpairs(defaultOptions)doifoptions[k]==nilthenoptions[k]=vendend-- Set initial "about" stringlocalpageType=(args.sectionandoptions.sectionString)oroptions.PageTypelocalabout=''ifargs[1]thenabout=string.format(options.aboutForm,pageType,args[1])end--Allow passing through certain optionslocalfsOptions={otherText=options.otherText,extratext=args.text}localhnOptions={selfref=args.selfref}-- Set for-see listlocalforSee=mHatList._forSee(args,2,fsOptions)-- Concatenate and returnreturnmHatnote._hatnote(about..forSee,hnOptions)endreturnp