Jump to content
Wikipedia The Free Encyclopedia

Module:About

From Wikipedia, the free encyclopedia
Module documentation[view] [edit] [history] [purge]
Warning This Lua module is used on 166,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.
Page template-protected This module is currently protected from editing.
See the protection policy and protection log for more details. Please discuss any changes on the talk page; you may submit an edit request to ask an administrator to make an edit if it is uncontroversial or supported by consensus. You may also request that this page be unprotected.
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'.
The above documentation is transcluded from Module:About/doc. (edit | history)
Editors can experiment in this module's sandbox (edit | diff) and testcases (edit | run) pages.
Subpages of this module.

 localmArguments--initialize lazily
 localmHatnote=require('Module:Hatnote')
 localmHatList=require('Module:Hatnote list')
 locallibraryUtil=require('libraryUtil')
 localcheckType=libraryUtil.checkType
 localp={}

 functionp.about(frame)
 -- A passthrough that gets args from the frame and all
 mArguments=require('Module:Arguments')
 args=mArguments.getArgs(frame)
 returnp._about(args)
 end


 functionp._about(args,options)
 -- Produces "about" hatnote.

 -- Type checks and defaults
 checkType('_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 list
 sectionString='section'
 }
 fork,vinpairs(defaultOptions)do
 ifoptions[k]==nilthenoptions[k]=vend
 end

 -- Set initial "about" string
 localpageType=(args.sectionandoptions.sectionString)oroptions.PageType
 localabout=''
 ifargs[1]then
 about=string.format(options.aboutForm,pageType,args[1])
 end

 --Allow passing through certain options
 localfsOptions={
 otherText=options.otherText,
 extratext=args.text
 }
 localhnOptions={
 selfref=args.selfref
 }

 -- Set for-see list
 localforSee=mHatList._forSee(args,2,fsOptions)

 -- Concatenate and return
 returnmHatnote._hatnote(about..forSee,hnOptions)
 end

 returnp

AltStyle によって変換されたページ (->オリジナル) /