Template:Documentation/end box: Difference between revisions

From Open Food Facts wiki
(fork from https://www.wikidata.org/wiki/Template:Documentation/end_box)
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<!--
{{Delete}}
  Link box below for the doc meta-data:
-->{{#if:
  <!--Check if we should show the link box-->
  {{#ifeq: {{{link box|}}} | off
  |
  | {{{doc exist|yes}}}{{
    #switch: {{SUBJECTSPACE}}
    | {{ns:User}}
    | {{ns:Module}}
    | {{ns:Template}} = yes
    }}
  }}
| {{fmbox
  | id = documentation-meta-data
  | image = none
  | class = mw-content-{{dir|{{Documentation/getText|lang}}}}
  | style = background-color: #ecfcf4;
  | textstyle = font-style: italic;
  | text =
    {{#if: {{{link box|}}}
    | {{{link box}}}  <!--Use custom link box content-->
    | {{#if: {{{doc exist|yes}}}
      | {{Documentation/getText|template end desc|[[{{{docpage|{{FULLPAGENAME}}/doc}}}]] <small style{{=}}"font-style: normal">([{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}|action=edit}} {{Documentation/getText|edit}}] &#124; [{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}|action=history}} {{Documentation/getText|history}}])</small>}}<br>
      |<!-- /doc does not exist, ask to create one?
    -->{{#switch: {{SUBJECTSPACE}}
          | {{ns:Module}} = {{Documentation/getText|module create desc|{{fullurl: {{{docpage| {{FULLPAGENAME}}/doc }}} | action{{=}}edit&preload{{=}}Template:Documentation/preload-module-doc }}}}<br>
          | #default =
        }}
      }}<!--
        Add links to /sandbox and /testcases when appropriate:
  -->{{#switch: {{SUBJECTSPACE}}
      | {{ns:Module}}  = {{Documentation/getText|experiment module|{{{sandbox| {{FULLPAGENAME}}/sandbox }}}|{{#ifexist:{{{sandbox| {{FULLPAGENAME}}/sandbox }}}|<small style{{=}}"font-style: normal">([{{fullurl: {{{sandbox| {{FULLPAGENAME}}/sandbox }}} | action{{=}}edit }} {{Documentation/getText|edit}}] &#124; [{{fullurl:Special:ComparePages | page1{{=}}{{urlencode:{{{template page|{{FULLPAGENAME}}}}}}}&page2{{=}}{{urlencode:{{{sandbox|{{FULLPAGENAME}}/sandbox}}}}}}} {{Documentation/getText|diff}}])</small>|<small style="font-style: normal">([{{fullurl: {{{sandbox| {{FULLPAGENAME}}/sandbox }}} | action=edit&preload=Template:Documentation/preload-{{#ifeq: {{SUBJECTSPACE}}|{{ns:Module}}|module-}}sandbox }} {{Documentation/getText|create}}] &#124; [{{fullurl: {{{sandbox| {{FULLPAGENAME}}/sandbox }}} | action=edit&preload={{urlencode:{{{template page|{{FULLPAGENAME}}}}}}}&summary={{urlencode:Create sandbox version of [[{{{template page|{{FULLPAGENAME}}}}}]]}} }} {{Documentation/getText|mirror}}])</small>}}|{{{testcases| {{FULLPAGENAME}}/testcases }}}|{{#ifexist: {{{testcases| {{FULLPAGENAME}}/testcases }}}|<small style="font-style: normal">([{{fullurl: {{{testcases| {{FULLPAGENAME}}/testcases }}} | action=edit }} {{Documentation/getText|edit}}])</small>|<small style="font-style: normal">([{{fullurl: {{{testcases| {{FULLPAGENAME}}/testcases }}} | action=edit&preload=Template:Documentation/preload-{{#ifeq: {{SUBJECTSPACE}}|{{ns:Module}}|module-}}testcases }} {{Documentation/getText|create}}])</small>}}}}<br />
      | {{ns:User}}
      | {{ns:Template}} = {{Documentation/getText|experiment template|{{{sandbox| {{FULLPAGENAME}}/sandbox }}}|{{#ifexist:{{{sandbox| {{FULLPAGENAME}}/sandbox }}}|<small style{{=}}"font-style: normal">([{{fullurl: {{{sandbox| {{FULLPAGENAME}}/sandbox }}} | action{{=}}edit }} {{Documentation/getText|edit}}] &#124; [{{fullurl:Special:ComparePages | page1{{=}}{{urlencode:{{{template page|{{FULLPAGENAME}}}}}}}&page2{{=}}{{urlencode:{{{sandbox|{{FULLPAGENAME}}/sandbox}}}}}}} {{Documentation/getText|diff}}])</small>|<small style="font-style: normal">([{{fullurl: {{{sandbox| {{FULLPAGENAME}}/sandbox }}} | action=edit&preload=Template:Documentation/preload-{{#ifeq: {{SUBJECTSPACE}}|{{ns:Module}}|module-}}sandbox }} {{Documentation/getText|create}}] &#124; [{{fullurl: {{{sandbox| {{FULLPAGENAME}}/sandbox }}} | action=edit&preload={{urlencode:{{{template page|{{FULLPAGENAME}}}}}}}&summary={{urlencode:Create sandbox version of [[{{{template page|{{FULLPAGENAME}}}}}]]}} }} {{Documentation/getText|mirror}}])</small>}}|{{{testcases| {{FULLPAGENAME}}/testcases }}}|{{#ifexist: {{{testcases| {{FULLPAGENAME}}/testcases }}}|<small style="font-style: normal">([{{fullurl: {{{testcases| {{FULLPAGENAME}}/testcases }}} | action=edit }} {{Documentation/getText|edit}}])</small>|<small style="font-style: normal">([{{fullurl: {{{testcases| {{FULLPAGENAME}}/testcases }}} | action=edit&preload=Template:Documentation/preload-{{#ifeq: {{SUBJECTSPACE}}|{{ns:Module}}|module-}}testcases }} {{Documentation/getText|create}}])</small>}}}}<br />
      }}<!--
        Show the cats text, but not
        if "content" fed or "docname fed" since then it is
        unclear where to add the cats.
  -->{{#if: {{{content|}}} {{{docname fed|}}}
      |
      | {{Documentation/getText|categories|{{{docpage|{{FULLPAGENAME}}/doc}}}}}
      }}<!--
        Show the "Subpages" link:
  -->{{#switch: {{SUBJECTSPACE}}
      | {{ns:File}}    = <!--Don't show it-->
      | {{ns:Module}}  = &#32;{{Documentation/getText|subpages module|Special:PrefixIndex/{{{template page|{{FULLPAGENAME}}}}}/}}
      | {{ns:Template}} = &#32;{{Documentation/getText|subpages template|Special:PrefixIndex/{{{template page|{{FULLPAGENAME}}}}}/}}
      | #default        = &#32;{{Documentation/getText|subpages page|Special:PrefixIndex/{{{template page|{{FULLPAGENAME}}}}}/}}
      }}
    }}{{#ifexist:{{FULLPAGENAME}}/Print
    |<br />{{Documentation/getText|print|{{FULLPAGENAME}}/Print}}[[Category:Templates with print versions]]
    }}
  }}
}}<!--End link box--><!--
  Detect and report strange usage:
-->{{#if:
  <!--Check if {{documentation}} is transcluded
      on a /doc or /testcases page-->
  {{#switch: {{SUBPAGENAME}}
  | doc
  | testcases = strange
  }}
  <!--More checks can be added here, just return anything
      to make the surrounding if-case trigger-->
| <includeonly>[[Category:Wikipedia pages with strange ((documentation)) usage|{{main other|Main:}}{{FULLPAGENAME}}]]<!-- Sort on namespace --></includeonly>
}}

Latest revision as of 09:52, 12 April 2024