Jump to content

Template:ROOT/Template Documentation

From Wikibooks, open books for an open world

This is a template designed for the book ROOT. It should be used to mark template documentation sites.

Syntax

[edit source]
{{ROOT/Template Documentation}}

How to document a template for the book ROOT

[edit source]

Say we want a template MyTemplate.

  1. First we create the template on the page Template:ROOT/MyTemplate
  2. Next we create an other template on the page Template:ROOT/Template Documentation/MyTemplate. On this page we put the documentation and embed this box[1].
  3. Important: Put <noinclude></noinclude> tags around the {{ROOT/Template Documentation}} so it won't appear on pages where the documentation is just embedded.
  4. Now we embed the documentation on the template's site via: {{ROOT/Template Documentation}}.
  5. Important: The syntax Template:ROOT/MyTemplate and Template:ROOT/Template Documentation/MyTemplate must be strictly followed or the thing won't work.

Example

[edit source]

Since this template analyzes the page information, an example can't be given. Check out the source of the template's own documentation site for an example if really needed.

<references>

  1. From a technical point of view, the documentation is of course a template again. But it would become an awkward loop to document it again. Since a documentation template never takes any parameters and has an obvious purpose, it should be absolutely clear how to use it even without documentation.