|
|
| Line 1: |
Line 1: |
| <includeonly>{{#ifeq:{{SITENAME}}|Templates Wiki|<div style="margin:0 1em;clear:both;"><div style="font-size:small;line-height:16px;"> | | <div class="template-documentation plainlinks"> |
| {{#ifeq:{{{SPW}}}|is not relevant|| | | {{#ifeq:{{{heading|μ}}}|<!--**DEFINED BUT EMPTY**--> |
| :'''''[{{fullurl:Special:Export}}?link1=Template:{{PAGENAMEE}}&link2=Template:{{PAGENAMEE}}/doc{{#if:{{{dep1|}}}
| | |<!--**NOTHING**--> |
| |&link3={{{dep1}}}&link4={{{dep1}}}/doc}}{{#if:{{{dep2|}}} | | |<div style="padding-bottom:3px; border-bottom: 1px solid #aaa; margin-bottom:1ex">{{#ifeq:{{{content|μ}}}|μ |
| |&link5={{{dep2}}}&link6={{{dep2}}}/doc}}{{#if:{{{dep3|}}} | | |<span class="editsection plainlinks" id="doc_editlinks">{{#ifexist: {{{1|{{Documentation/docname}}}}} |
| |&link7={{{dep3}}}&link8={{{dep3}}}/doc}}{{#if:{{{dep4|}}}
| | |<!--** /doc EXISTS** -->[[{{fullurl:{{{1|{{Documentation/docname}}}}}|action=edit}} edit]] [{{purge|purge}}] |
| |&link9={{{dep4}}}&link10={{{dep4}}}/doc}} Export this template]''', then [[Help:Importing|import]], to install it. | | |<!--**/doc DOESN'T EXIST**-->[[{{fullurl:{{{1|{{Documentation/docname }}}}}|action=edit&preload=Template:Documentation/preload}} create]] |
| <!--:''Or copy [{{FULLURL:{{FULLPAGENAME}}}}?action=edit {{FULLPAGENAME}}]<sup>[[Special:Export/{{FULLPAGENAME}}|export]]</sup>, [{{FULLURL:{{FULLPAGENAME}}/doc}}?action=edit {{FULLPAGENAME}}/doc]<sup>[[Special:Export/{{FULLPAGENAME}}/doc|export]]</sup>{{#if:{{{dep1|}}}|, | | }}</span> |
| [{{FULLURL:{{{dep1}}}}}?action=edit {{{dep1}}}]<sup>[[Special:Export/{{{dep1}}}|export]]</sup>{{#if:{{{dep2|}}}|,
| | }} <span style="{{#if:{{{heading-style|}}}|{{{heading-style}}}|{{#ifeq:{{NAMESPACE}}|{{ns:template}}|font-weight: bold; font-size: 125%|font-size: 150%}}}}">{{#if:{{{heading|}}}|{{{heading}}}|{{#ifeq:{{NAMESPACE}}|{{ns:template}}|[[Image:Template-info.svg|50px|link=]] Template documentation|Documentation}}}}</span></div> |
| [{{FULLURL:{{{dep2}}}}}?action=edit {{{dep2}}}]<sup>[[Special:Export/{{{dep2}}}|export]]</sup>}}{{#if:{{{dep3|}}}|,
| | }}<!-- |
| [{{FULLURL:{{{dep3}}}}}?action=edit {{{dep3}}}]<sup>[[Special:Export/{{{dep3}}}|export]]</sup>}}}} to the same locations on your wiki. [[Help:How_to_copy_templates_to_your_wiki|Need help?]]''-->
| |
| :''Use edit summary: ''<code><nowiki>Copied from [[w:c:templates:</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>'' to properly attribute this template's editors.''}}{{#if:{{{vanilla|}}}|
| |
| :''This template is compatible with vanilla Mediawiki.''}}
| |
| :''{{#switch: {{{SPW|{{Template:Is SPW}}}}}
| |
| | is newer
| |
| | is newer than =
| |
| [[w:c:templates:Help:Starter pages|This template is probably newer than one that is already on your wiki.]]{{#ifeq: {{SITENAME}} | Templates Wiki | [[Category:Newer than on starter pages|{{PAGENAME}}]] }}
| |
| | is not relevant
| |
| | is not relevant to =
| |
| This template is not on [[w:c:starter|Fandom starter pages]] because it is probably not relevant to wikis other than Templates Wiki. '''You probably don't want to copy this template to your wiki.''' {{#if:{{{SPW-link|}}}|For a similar template intended to be copied, see [[:Template:{{{SPW-link}}}]].}} {{#ifeq: {{SITENAME}} | Templates Wiki | [[Category:Templates Wiki templates|{{PAGENAME}}]] }}
| |
| | true <!-- Automatically checked against list of SPW templates at Template: Is SPW -->
| |
| | is on =
| |
| [[w:c:templates:Help:Starter pages|This template is probably already on your wiki.]]{{#ifeq: {{SITENAME}} | Templates Wiki | [[Category:From starter pages|{{PAGENAME}}]] }}
| |
| | is not on
| |
| | #default =
| |
| [[w:c:templates:Help:Starter pages|This template is probably not already on your wiki.]]
| |
| }}''</div>
| |
| </div>
| |
| {{#ifeq:{{CONTENTLANG}}|ja||{{#if:{{{ja|}}}|[[Category:Interwiki specified]][[ja:{{{ja}}}]]|{{#switch:{{{nothing|{{Is JA}}}}}|true=[[ja:Template:{{PAGENAME}}]]}}}}}}
| |
| {{#ifeq:{{CONTENTLANG}}|zh||{{#if:{{{zh|}}}|[[Category:Interwiki specified]][[zh:{{{zh}}}]]|{{#switch:{{{nothing|{{Is ZH}}}}}|true=[[zh:Template:{{PAGENAME}}]]}}}}}} | |
| {{#ifeq:{{CONTENTLANG}}|en||{{#if:{{{en|}}}|[[Category:Interwiki specified]][[en:{{{en}}}]]|{{#switch:{{{nothing|{{Is EN 1}}{{Is EN 2}}{{Is EN 3}}}}}|true=[[en:Template:{{PAGENAME}}]]}}}}}}|<span style="color:red;">'''You don't want this version of the documentation template on your wiki! [{{fullurl:Template:Documentation}}?action=history Click here to revert it.]'''</span>
| |
|
| |
|
| For a documentation template you can use on your wiki, see [[w:c:templates:Template:Documentation (copy)]].}}<!--
| | --><div id="template_doc_page_transcluded" class="dablink plainlinks"><!-- |
| | -->{{#ifexist: {{{1|{{Documentation/docname}}}}} |
| | |<!--**/doc EXISTS**-->This documentation is [[Wikipedia:Transclusion|transcluded]] from [[{{{1|{{Documentation/docname}}}}}]]. <small style="font-style: normal">([{{fullurl:{{{1|{{Documentation/docname}}}}}|action=edit}} edit] | [{{fullurl:{{{1|{{Documentation/docname}}}}}|action=history}} history])</small><br /> |
| | }}<!-- |
|
| |
|
| End of documentation blob - the ONLY part returned if called by "Template:Documentation (copy)"
| | -->{{#switch: {{SUBPAGENAME}} |
| | | |sandbox|testcases=<!--**DO NOT SHOW THESE LINKS ON THE SANDBOX/TESTCASES PAGES**--> |
| --> | | |#default= |
| {{#ifeq:{{PAGENAME}}|Documentation (copy)|| | | {{#switch: {{SUBJECTSPACE}} |
| {{{!}} class="article-table" style="width:100%;" role="complementary"
| | |{{ns:template}} |
| {{!}}- style="font-size:18px;"
| | |{{ns:user}}= |
| ! style="padding:0px;" {{!}} <div style="width:100%; padding:3px 0px; text-align:center;" class="color1">Template documentation</div>
| | {{#ifexist: {{FULLPAGENAME}}/sandbox |
| {{!}}- | | |This template has a [[/sandbox|sandbox]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /sandbox }}|action=edit}} edit])</small> <!-- |
| {{!}} ''Note: the template above may sometimes be partially or fully invisible.'' | | -->{{#ifexist: {{FULLPAGENAME}}/testcases |
| {{!}}-
| | |and [[/testcases|testcases]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /testcases }}|action=edit}} edit])</small>}} for editors to experiment. |
| {{!}}
| | |{{#ifexist: {{FULLPAGENAME}}/testcases |
| {{#if:{{{content|}}}|
| | |This template has [[/testcases|testcases]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /testcases }}|action=edit}} edit])</small> for editors to experiment.}} |
| Edit [{{fullurl:{{FULLPAGENAME}}}}?action=edit&preload=Template:Documentation/preload this template for the documentation].|
| | }}}}}} |
| {{#ifexist: {{#if: {{{1|}}}
| | </div> |
| | {{{1}}}
| | {{#if:{{{content|}}}|{{{content}}}|{{#ifexist:{{{1|{{Documentation/docname}}}}} | {{ {{{1|{{Documentation/docname}}}}} }} }}}} |
| | {{FULLPAGENAME}}/doc
| | <div style="clear: both;"></div> |
| }}<!--end if 1--> |
| | </div> |
| View or edit [[:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}/doc}}|this documentation]].
| | <noinclude> |
| |
| | [[Category:Templates]] |
| [{{fullurl:{{#if: {{{1|}}} | | <!-- Add categories and interwikis to the /doc subpage, not here! --> |
| | {{{1}}}
| | </noinclude> |
| | {{FULLPAGENAME}}/doc
| |
| }}<!--end if 1-->
| |
| | action=edit&preload=Template:Documentation/preload
| |
| }}<!--end if content--> create this documentation]
| |
| }}<!--end ifeq PAGENAME--> ([[Template:Documentation|How does this work?]])
| |
| {{!}}-
| |
| {{!}} Editors can experiment with this template's {{#if: {{{sandbox|}}} | {{#switch: {{#sub:{{lc:{{{sandbox}}}}}|0|1}}
| |
| | y | t | 1 = [[{{FULLPAGENAME}}/sandbox|sandbox]] | |
| | #default = [{{fullurl:{{FULLPAGENAME}}/sandbox|action=edit}} sandbox] }}<!--end switch--> | [{{fullurl:{{FULLPAGENAME}}/sandbox|action=edit}} sandbox]}}<!--end if sandbox--> and {{#if: {{{testcases|}}} | {{#switch: {{#sub:{{lc:{{{testcases}}}}}|0|1}}
| |
| | y | t | 1 = [[{{FULLPAGENAME}}/testcases|test case]] | |
| | #default = [{{fullurl:{{FULLPAGENAME}}/testcases|action=edit}} test case] }}<!--end switch--> | [{{fullurl:{{FULLPAGENAME}}/testcases|action=edit}} test case]}} pages.
| |
| {{!}}}
| |
| }}<!--end if testcases-->
| |
| {{#ifeq:{{PAGENAME}}|Documentation (copy)||
| |
| {{#if:{{{content|}}}|{{{content}}}| | |
| {{#if:{{{1|}}}|{{{{{1}}}}}|{{{{FULLPAGENAME}}/doc}}}} | |
| }}<!--end if 1-->}}<!--end if content-->}}<!--end ifeq PAGENAME--> | |
| </includeonly><noinclude> | |
| {{Documentation|SPW = is not relevant|SPW-link = Documentation (copy)|sandbox=yes|content= This is a version of Template:Documentation customized for Templates Wiki and so not designed to be copied to other wikis.
| |
| | |
| It acts identically to the usual Template:Documentation - and should be treated identically - except for a few particular cases.
| |
| * <code>content = </code> should the template have just a short blurb for documentation and not need a new page for it.
| |
| * <code>sandbox = yes</code> should the template have a /sandbox page.
| |
| * <code>testcases = yes</code> should the template have a /testcases page.
| |
| * If the template '''should transclude a documentation page other than its /doc subpage,''' use <code><nowiki>{{Documentation|documentation page}}</nowiki></code>.
| |
| *: You may also use <code><nowiki>{{Documentation|content=documentation goes here}}</nowiki></code> to include documentation without a subpage at all.
| |
| * If the template '''should be [[Help:Interlanguage links|interlanguage linked]] but at a different name,''' use <code><nowiki>{{Documentation|ja=Japanese name|zh=Chinese name}}</nowiki></code>.
| |
| *: You might instead create a [[Help:redirect|redirect]] on the foreign-language wiki from the name used on this wiki to theirs (and then update the relevant template in [[#Maintenance]]).
| |
| *: Interlanguage links to existing Japanese and Chinese pages are automatically inserted if their names are equivalent, in which case no parameter is needed.
| |
| * SPW
| |
| ** <code>SPW=is newer than</code> - The template '''exists on [[w:c:starter:|FANDOM starter pages]] but has been upgraded'''.
| |
| ** <code>SPW=is not relevant</code> - The template (such as this one) are not relevant to wikis other than Templates Wiki.
| |
| ** The other possible relations to SPW - "<code>is not on</code>" and "<code>is on</code>" [and unchanged] are automatically inserted, in which cases no parameter is needed.
| |
| * <code>dep1=</code><code>dep2=</code><code>dep3=</code><code>dep4=</code> to name up to four dependency templates (include Template: prefix, no need to name /doc pages).
| |
| == Maintenance ==
| |
| * Periodically check [http://starter.wikia.com/index.php?title=Special%3AAllPages&from=&to=&namespace=10 the list of templates on FANDOM starter pages wiki] to see if the list encoded into [[:Template:Is SPW]] is up-to-date.
| |
| * Periodically check [http://ja.templates.wikia.com/index.php?title=Special%3AAllPages&from=&to=&namespace=10 the list of templates on Japanese Templates Wiki] to see if the list encoded into [[:Template:Is JA]] is up-to-date.
| |
| * Periodically check [http://zh.templates.wikia.com/index.php?title=Special%3AAllPages&from=&to=&namespace=10 the list of templates on Chinese Templates Wiki] to see if the list encoded into [[:Template:Is ZH]] is up-to-date.
| |
| }}[[Category:Documentation templates| ]]</noinclude>
| |
This template can be used on any other template page to transclude documentation on how to use the other template.
If a documentation subpage (/doc) already exists, the content of that page will be displayed (like in this case). Otherwise, it will show a short note about missing documentation combined with a link to the subpage to be written.
This is useful to reduce the amount of wikicode that is transcluded every time the template in question is used. Everything that does not need to be transcluded should be put on this subpage, including interwiki links.
Usage
When creating a template page, copy and paste the following, to automatically insert the Usage information, if it exists.
<noinclude>{{doc}}</noinclude>