Difference between revisions of "Template:Documentation"

From WPRDC Wiki
Jump to navigation Jump to search
>Davidgothberg
(Adding automatic adding of {{template sandbox notice}} when on a /sandbox page. See talkpage section "Request".)
>Davidgothberg
(Now uses /core. Doc links now in a box below the main doc box. Link /sandbox and /testcases also when they don't exist, with (create) links with preload. See talkpage, section "Documentation/links".)
Line 15: Line 15:
}}<!--
}}<!--
   Start of green doc box.
   Start of green doc box.
--><div class="template-documentation"><!--
-->{{documentation/core
 
| heading = {{{heading|¬}}}   <!--Empty but defined means no header-->
These are the literal class definitions in MediaWiki:Common.css:
| heading-style = {{{heading-style|}}}
 
| content = {{{content|}}}
/* For template documentation */
| docpage =
.template-documentation {
   {{#if: {{{1|}}}
    clear: both;
  | {{{1|}}}
    margin: 1em 0 0 0;
  | {{#switch: {{SUBPAGENAME}}
    border: 1px solid #aaa;
    | sandbox
    background-color: #ecfcf4;
    | testcases = {{#rel2abs: ../doc }}
    padding: 1em;
    | #default = {{SUBJECTPAGENAME}}/doc
}
    }}
 
   }}
-->{{#ifeq:{{{heading|μ}}}|<!--**DEFINED BUT EMPTY**-->
| doc exist =  
  |<!--**NOTHING**-->
  {{#ifexist:
  |<div style="padding-bottom:3px; border-bottom: 1px solid #aaa; margin-bottom:1ex">{{#ifeq:{{{content|μ}}}
    {{#if: {{{1|}}}
  |<span class="editsection plainlinks" id="doc_editlinks">{{#ifexist: {{{1|{{Documentation/docname}}}}}
    | {{{1|}}}
    |<!--**    /doc EXISTS**   -->[[{{fullurl:{{{1|{{Documentation/docname}}}}}|action=edit}} edit]] [{{purge|purge}}]
    | {{#switch: {{SUBPAGENAME}}
    |<!--**/doc DOESN'T EXIST**-->[[{{fullurl:{{{1|{{Documentation/docname }}}}}|action=edit&preload=Template:Documentation/preload}} create]]
      | sandbox
  }}</span>
      | testcases = {{#rel2abs: ../doc }}
   }} <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]] Template documentation|Documentation}}}}</span></div>
      | #default = {{SUBJECTPAGENAME}}/doc
}}<!--
      }}
 
    }}
--><div id="template_doc_page_transcluded" class="dablink plainlinks"><!--
  | yes
   -->{{#ifexist: {{{1|{{Documentation/docname}}}}}
  }}
   |<!--**/doc EXISTS**-->This [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from [[{{{1|{{Documentation/docname}}}}}]]. <small style="font-style: normal">([{{fullurl:{{{1|{{Documentation/docname}}}}}|action=edit}} edit] &#124; [{{fullurl:{{{1|{{Documentation/docname}}}}}|action=history}} history])</small><br />
| sandbox =  
}}{{Documentation/links}}<!-- Add links to /sandbox and /testcases when appropriate -->
   {{#switch: {{SUBPAGENAME}}
</div>
   | sandbox
{{#if:{{{content|}}}|{{{content}}}|{{#ifexist:{{{1|{{Documentation/docname}}}}} | {{ {{{1|{{Documentation/docname}}}}} }} }}}}
  | testcases = {{#rel2abs: ../sandbox }}
<div style="clear: both;"></div>
  | #default = {{FULLPAGENAME}}/sandbox
</div><!--End of green doc box--><noinclude>
  }}
| testcases =
  {{#switch: {{SUBPAGENAME}}
  | sandbox
  | testcases = {{#rel2abs: ../testcases }}
  | #default = {{FULLPAGENAME}}/testcases
  }}
}}<!--End of green doc box--><noinclude>


<!-- Add categories and interwikis to the /doc subpage, not here! -->
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
</noinclude>

Revision as of 04:03, 6 February 2010