Latest revision |
Your text |
Line 1: |
Line 1: |
− | {{Documentation subpage}} | + | __NOTOC__ {{Documentation subpage}} |
| <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> |
| {{Lua|Module:Parameters}} | | {{Lua|Module:Parameters}} |
− | __NOTOC__
| |
| == Usage == | | == Usage == |
− | {{Tl|Parameters}} extracts a specified template's parameters and performs a variety of tasks to aid in its documentation or [[WP:TFD]] merge nominations. It itself takes two parameters: {{Para|1}}, the output format; and {{Para|base}}, the title of a template. The <code>compare</code> function requires a third parameter, {{Para|other}}. {{Tl|Parameters}} ''must'' always be substituted. Its usage is demonstrated below.
| + | [[Template:Parameters]] extracts a specified template's parameters to aid in its documentation or [[WP:TFD]] merge nominations. It itself takes two parameters: {{Para|1}}, the output format; and {{Para|base}}, the title of a template. [[Template:Parameters]] ''must'' always be substituted. Its usage is demonstrated below. |
| | | |
| === Options === | | === Options === |
− |
| |
− | ==== check ====
| |
− | Generates an invocation of [[Module:Check for unknown parameters]] which can be added to a template.
| |
− | <pre style="margin-left:20px;margin-right:20px;">{{subst:Parameters|check|base={{subst:BASEPAGENAME}}}}</pre>
| |
− | {{Hidden |style=margin-left:20px;margin-right:20px;border:1px solid #ddd; |header=Output |content=
| |
− | <pre style="white-space: normal; word-break: break-all;">{{#invoke:Check for unknown parameters|check|unknown=[[Category:Pages using Template:Infobox high court with unknown parameters]]|court_name|native_name|image|imagesize|width|height|caption|image2|imagesize2|caption2|established|dissolved|country|location|coordinates|motto|type|at|authority|appeals|terms|positions|budget|website|chiefjudgetitle|chiefjudgename|termstart|termend|termend2|chiefjudgetitle2|chiefjudgename2|termstart2|termend3|termend4}}</pre>
| |
− | }}
| |
− |
| |
| ==== code ==== | | ==== code ==== |
− | Generates code to display the transclusion syntax (a blank template) which can added to a template's documentation. {{Para|pad|yes}} aligns the equal signs vertically.
| + | <pre>{{subst:Parameters|code|base=Infobox high court}}</pre> |
− | <pre style="margin-left:20px;margin-right:20px;">{{subst:Parameters|code|base={{subst:BASEPAGENAME}}}}</pre> | + | {{Hidden|header=Output|content= |
− | {{Hidden |style=margin-left:20px;margin-right:20px;border:1px solid #ddd; |header=Output |content= | |
| <pre>{{Infobox high court | | <pre>{{Infobox high court |
| | court_name = | | | court_name = |
Line 58: |
Line 48: |
| | | |
| ==== compare ==== | | ==== compare ==== |
− | Generates a comparison of the parameters available in two different templates.
| + | <pre>{{subst:Parameters|compare|base=Infobox London station|other=Infobox station}}</pre> |
− | <pre style="margin-left:20px;margin-right:20px;">{{subst:Parameters|compare|base=Infobox London station|other=Infobox station}}</pre> | + | {{Hidden|header=Output|content= |
− | {{Hidden |style=margin-left:20px;margin-right:20px;border:1px solid #ddd; |header=Output |content= | |
| <pre>Identical: | | <pre>Identical: |
| * borough | | * borough |
Line 215: |
Line 204: |
| | | |
| ==== demo ==== | | ==== demo ==== |
− | Generates an invocation of {{tl|Parameter names example}}, formerly known as {{tl|Generic template demo}}, which can added to a template's documentation.
| + | <pre>{{subst:Parameters|demo|base=Infobox high court}}</pre> |
− | <pre style="margin-left:20px;margin-right:20px;">{{subst:Parameters|demo|base={{subst:BASEPAGENAME}}}}</pre> | + | {{Hidden|header=Output|content= |
− | {{Hidden |style=margin-left:20px;margin-right:20px;border:1px solid #ddd; |header=Output |content= | |
| <pre style="white-space: normal; word-break: break-all;">{{Parameter names example|court_name|native_name|image|imagesize|width|height|caption|image2|imagesize2|caption2|established|dissolved|country|location|coordinates|motto|type|at|authority|appeals|terms|positions|budget|website|chiefjudgetitle|chiefjudgename|termstart|termend|termend2|chiefjudgetitle2|chiefjudgename2|termstart2|termend3|termend4}}</pre> | | <pre style="white-space: normal; word-break: break-all;">{{Parameter names example|court_name|native_name|image|imagesize|width|height|caption|image2|imagesize2|caption2|established|dissolved|country|location|coordinates|motto|type|at|authority|appeals|terms|positions|budget|website|chiefjudgetitle|chiefjudgename|termstart|termend|termend2|chiefjudgetitle2|chiefjudgename2|termstart2|termend3|termend4}}</pre> |
− | }}
| |
− |
| |
− | ==== dlist ====
| |
− | Generates a parameter description list which can be filled in and added to a template's documentation. The output uses the semicolon and colon format where the parameter name is displayed in bold text and the description is indented.
| |
− | <pre style="margin-left:20px;margin-right:20px;">{{subst:Parameters|dlist|base={{subst:BASEPAGENAME}}}}</pre>
| |
− | {{Hidden |style=margin-left:20px;margin-right:20px;border:1px solid #ddd; |header=Output |content=
| |
− | <pre>
| |
− | ; court_name:
| |
− | ; native_name:
| |
− | ; image:
| |
− | ; imagesize:
| |
− | ; width:
| |
− | ; height:
| |
− | ; caption:
| |
− | ; image2:
| |
− | ; imagesize2:
| |
− | ; caption2:
| |
− | ; established:
| |
− | ; dissolved:
| |
− | ; country:
| |
− | ; location:
| |
− | ; coordinates:
| |
− | ; motto:
| |
− | ; type:
| |
− | ; at:
| |
− | ; authority:
| |
− | ; appeals:
| |
− | ; terms:
| |
− | ; positions:
| |
− | ; budget:
| |
− | ; website:
| |
− | ; chiefjudgetitle:
| |
− | ; chiefjudgename:
| |
− | ; termstart:
| |
− | ; termend:
| |
− | ; termend2:
| |
− | ; chiefjudgetitle2:
| |
− | ; chiefjudgename2:
| |
− | ; termstart2:
| |
− | ; termend3:
| |
− | ; termend4:
| |
− | </pre>
| |
| }} | | }} |
| | | |
| ==== list ==== | | ==== list ==== |
− | Generates a parameter description list which can be filled in and added to a template's documentation. Similar to '''dlist''' but uses asterisks which will generate a bulleted list.
| + | <pre>{{subst:Parameters|list|base=Infobox high court}}</pre> |
− | <pre style="margin-left:20px;margin-right:20px;">{{subst:Parameters|list|base={{subst:BASEPAGENAME}}}}</pre> | + | {{Hidden|header=Output|content= |
− | {{Hidden |style=margin-left:20px;margin-right:20px;border:1px solid #ddd; |header=Output |content= | |
| <pre>* court_name | | <pre>* court_name |
| * native_name | | * native_name |
Line 302: |
Line 247: |
| * termend4</pre> | | * termend4</pre> |
| }} | | }} |
− |
| |
− | === Common use cases ===
| |
− | * To add a {{Tl|Parameter names example}} to a template's documentation, use: <code><nowiki>{{subst:Parameters|demo|base={{subst:BASEPAGENAME}}|_base=}}</nowiki></code>
| |
− | * To document the transclusion syntax, use: <code><nowiki>{{subst:#tag:pre|{{subst:Parameters|code|base={{subst:BASEPAGENAME}}}}|style=overflow: auto;}}</nowiki></code>
| |
| | | |
| <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | |
| <!-- Categories below this line, please; interwikis at Wikidata --> | | <!-- Categories below this line, please; interwikis at Wikidata --> |
− | [[Category:Documentation assistance templates]]
| + | |
− | [[Category:Wikipedia utility templates]]
| |
− | [[Category:Template namespace templates]]
| |
− | [[Category:Template documentation]]
| |
| }}</includeonly> | | }}</includeonly> |