Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Module:About

Permanently protected module
From Wikipedia, the free encyclopedia
Module documentation[view] [edit] [history] [purge]
WarningThis Lua module is used on166,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 ownmodule sandbox. The tested changes can be added to this page in a single edit. Consider discussing changes on thetalk page before implementing them.
Thismodule is rated asready 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 onhelp pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed throughsandbox testing rather than repeated trial-and-error editing.
Page template-protectedThis module is currentlyprotected from editing.
See theprotection policy andprotection log for more details. Please discuss any changes on thetalk page; you maysubmit an edit request to ask anadministrator to make an edit if it isuncontroversial or supported byconsensus. You may alsorequest that this page be unprotected.
This module depends on the following other modules:

This module implements the{{about}}hatnote template.

Usage

  • Theabout 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 argumentsection is specified. Defaults to'section'.
The abovedocumentation istranscluded fromModule:About/doc.(edit |history)
Editors can experiment in this module'ssandbox(edit |diff) andtestcases(edit |run) pages.
Subpages of this module.

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
Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:About&oldid=967653971"
Categories:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp