Template:Documentation: Difference between revisions

From Fishtank Live Wiki
w:c:ftl>Celdrøn
(French was missing.)
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude><includeonly><!--
<!--
- Documentation template
- A template used to show the contents of a documentation subpage
- Note: Comments (<!-- --.>) are often used to avoid unnecessary line breaks or spaces.
-->
<!--
- Pre-defined variables
--><!--
-->{{#vardefine: base page |
  {{{page|
    {{#ifeq: {{SUBPAGENAME}} | sandbox
    | {{NAMESPACE}}:{{BASEPAGENAME}}
    | {{FULLPAGENAME}}
    }}
  }}}
}}<!--
 
-->{{#vardefine: current page | {{FULLPAGENAME}}}}<!--
 
-->{{#vardefine: doc page |
  {{#if: {{{page|}}}
  | {{{page}}}/doc
  | {{#if: {{{1|}}}
    | {{{1}}}
    | {{#var: base page}}/doc
    }}
  }}
}}<!--
 
-->{{#vardefine: namespace |
  {{{demospace|{{#ifeq: {{NAMESPACE}} | {{TALKSPACE}}
  | {{SUBJECTSPACE}}
  | {{NAMESPACE}}
  }}}}}
}}<!--
 
-->{{#vardefine: preload |
  {{{preload|Template:Documentation/preload}}}&summary={{urlencode:Create /doc subpage for [[{{#var: base page}}]]}}&editintro=Template:Documentation/editintro-doc
}}<!--
 
-->{{#vardefine: preload-sandbox |
  {{{preload-sandbox|Template:Documentation/preload-sandbox}}}&summary={{urlencode:Create sandbox subpage for experimenting on template [[{{#var: base page}}]]}}
}}<!--
 
-->{{#vardefine: preload-testcases |
  {{{preload-testcases|Template:Documentation/preload}}}&summary={{urlencode:Create testcases for [[{{#var: base page}}]]}}
}}<!--
 
-->{{#vardefine: sandbox |
  {{#if: {{{page|}}}
  | {{{page}}}/sandbox
  | {{{sandbox|{{#var: base page}}/sandbox}}}
  }}
}}<!--
 
-->{{#vardefine: testcases |
  {{#if: {{{page|}}}
  | {{{page}}}/testcases
  | {{{testcases|{{#var: base page}}/testcases}}}
  }}
}}<!--
 
-->{{#vardefine: page text |
  {{#switch: {{#var: namespace}}
  | {{ns:Template}} = template
  | {{ns:Module}} = module
  | #default = page
  }}
}}<!--
 
-->{{#vardefine: doc image |
  {{#ifeq: {{{heading|a}}} | <!-- null -->
  | <!-- heading is specified but empty, don't show image -->
  | [[File:{{#if: {{{content|}}}
    | Documentation_icon
    | {{#ifexist: {{#var: doc page}}
      | Documentation_icon
      | No Documentation_icon
      }}
    }}.svg|70px|link=|alt=|class=nomobile]]&nbsp;
  }}
}}<!--
-
-
- Article Header
- Sandbox header
-
-
-->{{#ifeq: {{SITENAME}}|Templates Wiki||<!--
-->{{#ifeq: {{SUBPAGENAMEE}} | sandbox
--><div style="margin:1em; padding:10px; border: 0.5px solid #c91010; border-radius:10px; background:#f001"><span class="error">'''Your wiki got a version of [[Template:Documentation]] that is only relevant to [[w:c:templates|Templates Wiki]]!''' [{{fullurl:Template:Documentation}}?action=history Click here to revert it.]</span>
  | <div class="article-table"
For a documentation template you can use on your wiki, see [[w:c:templates:Template:Documentation (copy)|Template:Documentation (copy) on Templates Wiki]].</div>}}<!--
style="padding: 1.5em; margin: auto; border: 1px solid #5556; border-bottom: 1px solid #5556; width:75%;"><!--
  -->This is a template sandbox subpage for [[{{#var: base page}}]]. <!--
  -->{{#ifexist: {{#var: testcases}}
    | See also the companion subpage for [[{{#var: testcases}}|the testcases]].
    }}<!--
--></div>
}}<!--


--><div style="text-align:center;"><span style="font-size:large;">Template information, documentation, and installation instructions.</span><br/>
--><div class="template-documentation" style="clear: both; border: 1px solid #5556; margin: 1em;"><!--
Expand the below text for usage and other information.</div>
----<!--
-
-
- Documentation Transclusion
- Documentation Header
-
-
-->{{#if: {{{installonly|}}} |<!-- Hide doc page, useful for documentation templates -->|<div style="padding:10px; border:1px solid #444c4d; clear:both; margin-bottom:0; border-bottom:unset; border-radius:10px 10px 0 0;" class="mw-collapsible article-table" data-collapsetext="Hide documentation" data-expandtext="Show documentation"><!--
--><div class="article-table" style="padding: 1em; margin: 0; border-bottom: 1px solid #5556;"><!--
- Documentation Header
  --><span style="font-size:1.5em">{{#var: doc image }}'''{{{heading|{{ucfirst: {{#var: page text}} }} Documentation}}}'''</span><!--
-->
-
<span style="font-size:large;">'''Template Documentation'''</span><!--
- Documentation page tools
<!--
-
-->:<div style="margin:0; padding:1em; border: 0.5px solid #444c4d; border-radius:10px;" class="mw-collapsible-content"><!--
--><span style="float: right">&#x5b;{{#if: {{{content|}}}
-->''Note: The template above might be broken without the parameters; this is normal.''<br/><!--
  | <!---->[[Special:EditPage/{{#var: current page}}|edit]] &#124; [[Special:Purge/{{#var: current page}}|purge]]
- Documentation Tools
   | {{#ifexist: {{#var: doc page}}
-->{{#if: {{{content|}}}
    | <!--
   | [{{fullurl: {{FULLPAGENAME}}|action=edit}} Edit this template] for the documentation<!--
    -->[[{{#var: doc page}}|view]] &#124; [[Special:EditPage/{{#var: doc page}}|edit]] &#124; [[Special:PageHistory/{{#var: doc page}}|history]] &#124; [[Special:Purge/{{#var: current page}}|purge]]
  -
     | <!--
-->| {{#ifexist: {{{1|{{FULLPAGENAME}}/doc}}}
      -->[{{fullurl:{{FULLPAGENAMEE:{{#var: doc page}}}}|action=edit&preload={{#var: preload}} }} create] &#124; [[Special:Purge/{{#var: current page}}|purge]]
    | View, edit, or check the history of [[:{{{1|{{FULLPAGENAME}}/doc}}}|this documentation]].
     |[{{fullurl: {{{1|{{FULLPAGENAME}}/doc}}}
              |action=edit&preload=Template:Documentation/preload<!--
            -->&summary={{urlencode:Create documentation for [[{{FULLPAGENAME}}]]}}
              }} Create documentation] for this template.
     }}
     }}
    }} ([[Template:Documentation/doc|How does this work?]])<br/>Editors can experiment with this template's [{{fullurl:{{{sandbox|{{FULLPAGENAME}}/sandbox}}}
  }}]</span><!--
   | action=edit&redlink=1&preload=Template:Documentation/preload-sandbox<!--
 
  -->&summary={{urlencode:Create sandbox version of [[{{FULLPAGENAME}}]]}}
--></div><!--
   }} sandbox] and [{{fullurl:{{{testcases|{{FULLPAGENAME}}/testcases}}}
-
  | action=edit&redlink=1&preload=Template:Documentation/preload-testcases<!--
- Documentation blurb
  -->&summary={{urlencode:Create testcases subpage of [[{{FULLPAGENAME}}]]}}
-
  }} testcases].
--><div style="padding: 1em; padding-bottom: 0; margin: 0;">
</div>
 
<!--
{{#ifeq: {{{content|a}}} | {{{content}}} | <!-- do nothing -->
| {{#ifexist: {{#var: doc page}}
   | {{<!---->{{#var:doc page}}}}
   | The [[w:Help:Template documentation|documentation]] for this {{#var: page text}} does not exist. Create it at [{{fullurl:{{FULLPAGENAMEE:{{#var: doc page}}}}|action=edit&preload={{#var: preload}} }} {{#var: doc page}}].
  }}
}}<!--
-
-
--><div style="background:none;" class="mw-collapsible-content">
-->{{{content|}}}
{{Tocright}}
 
{{#if:{{{content|}}}
  | {{{content}}}{{clear}}
 
  | {{#ifexist: {{{1|{{FULLPAGENAME}}/doc}}}
    | {{#if: {{{1|}}}
      |{{{{{1}}}}}
      |{{<!---->{{FULLPAGENAME}}/doc}}}}{{clear}}
    | Documentation does not exist. Create it at [{{fullurl:
              {{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}/doc}}
              |action=edit&preload=Template:Documentation/preload<!--
            -->&summary={{urlencode:Create documentation for [[{{FULLPAGENAME}}]]}}<!--
            --> {{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}/doc}}] [[category:templates without documentation]].
  }}<!--end if 1-->
}}
<!--end if content-->
}}
</div></div><div style="display:none;">
----
</div><!--
</div><!--
- Installation
-
-
-->}}<div style="padding:10px;border:1px solid #444c4d; margin-top:0; border-radius:0 0 10px 10px;" class="mw-collapsible article-table" data-collapsetext="Hide install instructions" data-expandtext="Show install instructions">
- End blurb
<span style="font-size:large;">'''Installation Instructions'''</span><!--
--><div class="mw-collapsible-content">
<!--
-
-
- The section for the exporting the template.
-->{{#if: {{{nofooter|}}} | |
<div class="article-table" style="clear: both; padding: 0.5em; margin: 0; border-top: 1px solid #5556;"><!--
-
-
--><div style="margin:1em; padding:5px; background:#0121; border: 0.5px solid #36475e; border-radius:10px;clear: both;">
- The above [documentation] is
  {{#ifeq:{{{SPW}}}|is not relevant
    |
    <!--
    - Export links
    -->
    | :'''''[{{fullurl:Special:Export}}?link1=Template:{{PAGENAMEE}}&link2=Template:{{PAGENAMEE}}/doc<!--
    -->{{#if:{{{dep1|}}}|&link3={{{dep1}}}&link4={{{dep1}}}/doc}}<!--
    -->{{#if:{{{dep2|}}}|&link5={{{dep2}}}&link6={{{dep2}}}/doc}}<!--
    -->{{#if:{{{dep3|}}}|&link7={{{dep3}}}&link8={{{dep3}}}/doc}}<!--
    -->{{#if:{{{dep4|}}}|&link9={{{dep4}}}&link10={{{dep4}}}/doc}}<!--
    - Alt text
    --><!--
    -
    - Main Text
    -
    --> Export this template]''', then [[w:Help:Importing and exporting pages|import]] to install it.<br/><!--
    -->''Use edit summary: ''<code><nowiki>Copied from [[w:c:templates:</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>'' to properly attribute this template's editors.}}<!--
    - If compatible with vanilla MediaWiki
    -->{{#if:{{{vanilla|}}}|:''This template is compatible with vanilla MediaWiki.''}}
    <!--
    -
    - is not relevant = Should be '''NOT''' copied
    -
    -->
:{{#switch: {{{SPW|}}}
    | starter = This template is created by default after March 11, 2020. It should be in your wiki. [[Category:Starter templates]]
| is not relevant
| is not relevant to = [[File:Warning.svg|left|50px]]<!--
    -->''This template should not be copied, 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]]
      }}
  }}
</div><!-- End Section -->
<!--
-
-
- Interlanguage links
-->{{#if: {{{content|}}}
-
  | <!-- do not show -->
--><!--
  | {{#ifexist: {{#var: doc page}}
- French
    | {{#ifeq: {{SUBPAGENAME}} | sandbox
-->{{#if:{{{fr|}}}
      | This is the sandbox subpage of [[{{#var: base page}}]];
    |[[fr:{{{fr}}}]]
      | The above
    |
      }}&nbsp;[[w:Help:Template documentation|documentation]] is [[mw:Help:Transclusion|transcluded]] from [[{{#var: doc page}}]]. <small>([[Special:EditPage/{{#var: doc page}}|edit]] &#124; [[Special:PageHistory/{{#var: doc page}}|history]])</small><br/>
 
    | {{#ifeq: {{#var: namespace}} | {{ns:Module}}
      | You might want to [{{fullurl:{{FULLPAGENAMEE:{{#var: doc page}}}}|action=edit&preload={{#var: preload}} }} create documentation] for this [[w:Help:Lua|Scribuntu module]]. <br/>
      | [{{fullurl:{{FULLPAGENAMEE:{{#var: doc page}}}}|action=edit&preload={{#var: preload}} }} Create documentation] for this template. <br/>
      }}
    }}
   }}<!--
   }}<!--
- Japanese
  -
-->{{#if:{{{ja|}}}
  - Sandbox and testcases.
    |[[ja:{{{ja}}}]]
  -
    |
  - NOTE: THIS WILL CREATE MANY (yes, MANY) REDLINKS (IF YOU DIDN'T MAKE THE /sandbox or /testcases PAGES). IF YOU DONT WANT THE LINKS, PLEASE REPLACE THE CODE BELOW WITH:
  <
    Editors can experiment in the page's [{{fullurl: {{#var: sandbox}}}} sandbox] and [{{fullurl: {{#var: testcases}}}} testcases] pages.
  >
  -
  --><!--
--><!-- CHANGE START --><!--
-->Editors can experiment in this {{#var: page text}}'s <!--
  -
-->{{#ifexist: {{#var: sandbox}}
  | [[{{#var: sandbox}}|sandbox]] <!--
  --><small>(<!--
    -->[[Special:EditPage/{{#var: sandbox}}|edit]] &#124; <!--
    -->[{{fullurl: Special:ComparePages
        | page1={{FULLPAGENAMEE:{{#var: base page}}}}&page2={{FULLPAGENAMEE:{{#var: current page}}}}
        }} diff]<!--
  -->)</small>
     
  | sandbox <small>(<!--
  -->[{{fullurl: {{FULLPAGENAMEE:{{#var: sandbox}}}}
    | action=edit&preload={{#var: preload-sandbox}}
    }} create] &#124; [{{fullurl: {{FULLPAGENAMEE:{{#var: sandbox}}}}
    | action=edit&preload={{FULLPAGENAMEE:{{#var: base page}}}}
    }} mirror]<!--
  -->)</small>
 
   }}<!--
   }}<!--
- Turkish
 
-->{{#if:{{{tr|}}}
  --> and <!--
    |[[tr:{{{tr}}}]]
 
    |
  -->{{#ifexist: {{#var:testcases}}
  }}<!--
    | [[{{#var:testcases}}|testcases]] <small>([[Special:EditPage/{{#var: testcases}}|edit]])</small>
- Simplified Chinese
   
-->{{#if:{{{zh|}}}
    | testcases <small>(<!--
    |[[zh:{{{zh}}}]]
    -->[{{fullurl: {{FULLPAGENAMEE:{{#var: testcases}}}}
     |
        | action=edit&preload={{#var: preload-testcases}}
    }}
        }} create]<!--
<!--
     -->)</small>
-
    }}<!--
- Installation Instructions
  --> pages.<br/><!--
-
  --><!-- CHANGE END --><!--
-->
  -
{{#ifeq: {{{SPW}}}|is not relevant |
  - Category addition text & subpages text.
|{{#if: {{PROTECTIONEXPIRY: edit |{{{install|{{FULLPAGENAME}}/install}}}}}
  -
  | ''The above message will be enough for most cases; if there are additional instructions, you can see them below.''<br/><!--
  -->{{#if: {{{content|{{{1|}}}}}}
  --> {{<!---->{{{install|{{FULLPAGENAME}}/install}}}}}
      | <!-- Do NOT show cat text *if* documentation is inline or transcluded from a different page. -->
  | :There is no additional installation instructions for this template. If there is any, you may create it at [{{fullurl:
      | {{#ifexist: {{#var: doc page}}
              {{{install|{{FULLPAGENAME}}/install}}}
        | Add [[w:Help:categories|categories]] and [[w:Help:interwiki links|interwikis]] to the [[{{#var: doc page}}|/doc]] subpage.&nbsp;
              |action=edit&preload=Template:Documentation/preload-install<!--
        }}
-->}} {{{install|{{FULLPAGENAME}}/install}}}].
      }}<!--
      -
      -->[[Special:PrefixIndex/{{#var: current page}}|Subpages of this {{#var: page text}}]].
</div>
}}
}}
}}
</div>
</div></div></includeonly></onlyinclude>
{{Documentation|SPW = is not relevant|SPW-link = Documentation (copy)|fr=Modèle:Documentation|ja=Template:Documentation|tr=Şablon:Belgelendirme|zh=Template:Documentation|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>installonly =</code> for documentation templates
* 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 [[w:Help:Interlanguage links|interlanguage linked]] but at a different name,''' use <code><nowiki>{{Documentation|fr=French name|ja=Japanese name|tr=Turkish name|zh=Chinese name}}</nowiki></code>.
*: You might instead create a [[w:Help:Redirect|redirect]] on the foreign-language wiki from the name used on this wiki to theirs.
* SPW
** <code>SPW=is not relevant</code> - The template (such as this one) are not relevant to wikis other than Templates Wiki.
** <code>SPW=starter</code> - The wikis after created on March 11, 2020 by default.
* <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).
}}[[Category:Documentation templates| ]]

Latest revision as of 19:25, 1 February 2024

{{#vardefine: base page |

   Template:Documentation
 

}}{{#vardefine: current page | Template:Documentation}}{{#vardefine: doc page |

 {{#var: base page}}/doc

}}{{#vardefine: namespace |

 Template

}}{{#vardefine: preload |

 Template:Documentation/preload&summary=Create+%2Fdoc+subpage+for+%5B%5B%7B%7B%23var%3A+base+page%7D%7D%5D%5D&editintro=Template:Documentation/editintro-doc

}}{{#vardefine: preload-sandbox |

 Template:Documentation/preload-sandbox&summary=Create+sandbox+subpage+for+experimenting+on+template+%5B%5B%7B%7B%23var%3A+base+page%7D%7D%5D%5D

}}{{#vardefine: preload-testcases |

 Template:Documentation/preload&summary=Create+testcases+for+%5B%5B%7B%7B%23var%3A+base+page%7D%7D%5D%5D

}}{{#vardefine: sandbox |

 {{#var: base page}}/sandbox

}}{{#vardefine: testcases |

 {{#var: base page}}/testcases

}}{{#vardefine: page text |

 page

}}{{#vardefine: doc image |

 File:No Documentation icon.svg 

}}

{{#var: doc image }}{{#var: page text}} Documentation[[https:https://fishtanklive.wiki/index.php?title=Template:Documentation&action=edit&preload={{#var: preload}} create] | [[Special:Purge/{{#var: current page}}|purge]]]

The documentation for this {{#var: page text}} does not exist. Create it at [https:https://fishtanklive.wiki/index.php?title=Template:Documentation&action=edit&preload={{#var: preload}} {{#var: doc page}}].

[https:https://fishtanklive.wiki/index.php?title=Template:Documentation&action=edit&preload={{#var: preload}} Create documentation] for this template.
Editors can experiment in this {{#var: page text}}'s sandbox ([https:https://fishtanklive.wiki/index.php?title=Template:Documentation&action=edit&preload={{#var: preload-sandbox}} create] | [https:https://fishtanklive.wiki/index.php?title=Template:Documentation&action=edit&preload= mirror]) and testcases ([https:https://fishtanklive.wiki/index.php?title=Template:Documentation&action=edit&preload={{#var: preload-testcases}} create]) pages.
[[Special:PrefixIndex/{{#var: current page}}|Subpages of this {{#var: page text}}]].