Template

Documentation2

From Dogcraft Wiki

mNo edit summary
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{Templates Nav}} {{{top|}}}  
<includeonly>{{{top|}}} {{Codeblock|title=|name=template|{{Template source|{{BASEPAGENAME}}}}}} {{Templates Nav}}
{{Codeblock|title=|name=template|{{Template source|{{BASEPAGENAME}}}}}}


<div class="template-documentation">
{{Documentation header|documentation = {{#ifexist: Template:{{BASEPAGENAME}}/doc | Template:{{BASEPAGENAME}}/doc }} }} <!--
{{Documentation header
-->{{#ifexist: Template:{{BASEPAGENAME}}/styles.css | {{TemplateStyles}} }} {{#if: {{{notoc|}}} || <div class="toc-container" style="float:right; margin-left:1rem; margin-bottom:.25rem; clear:right;">__TOC__</div> }}
| documentation = {{#ifexist: Template:{{BASEPAGENAME}}/doc | Template:{{BASEPAGENAME}}/doc }}
{{#ifexist: Template:{{BASEPAGENAME}}/doc | {{Template:{{BASEPAGENAME}}/doc}} }}</includeonly><noinclude>
}}
{{#ifexist: Template:{{BASEPAGENAME}}/styles.css | {{TemplateStyles}} }} <div class="toc-container" style="float:right; margin-left:1rem; margin-bottom:.25rem; clear:right;">__TOC__</div> {{#ifexist: Template:{{BASEPAGENAME}}/doc | {{Template:{{BASEPAGENAME}}/doc}} }}
</includeonly><noinclude>
{{documentation2}}
{{documentation2}}
Documentation can also be written on-page
Documentation can also be written on-page
[[Category:Documentation templates]]

Latest revision as of 01:20, 4 February 2026

{{{top|}}} {{Codeblock|title=|name=template|{{Template source|{{BASEPAGENAME}}}}}} {{Templates Nav}}

{{Documentation header|documentation = {{#ifexist: Template:{{BASEPAGENAME}}/doc | Template:{{BASEPAGENAME}}/doc }} }} <!--
-->{{#ifexist: Template:{{BASEPAGENAME}}/styles.css | {{TemplateStyles}} }} {{#if: {{{notoc|}}} || <div class="toc-container" style="float:right; margin-left:1rem; margin-bottom:.25rem; clear:right;">__TOC__</div> }}
{{#ifexist: Template:{{BASEPAGENAME}}/doc | {{Template:{{BASEPAGENAME}}/doc}} }}
Show full sourceHide full source
Index of templates

Template documentation


Documentation can be written on a /doc subpage, which will automatically be transcluded.

The /doc subpage should start at 3rd level headings

Because the template itself uses a 2nd level heading for the Template documentation top header.

If it has enough headings

The TOC will work properly and not be duplicated

Right??

It needs several headings for a TOC to trigger.

Like

this. Documentation can also be written on-page