Template documentation

Zur Navigation springen Zur Suche springen

What does template documentation with module Template documentation

Template documentation with module Template documentation has following properties:

  • always up-to-date
  • transparent
  • flexible
  • compact
  • showing multiple application cases
  • easy to use (copy&paste text)
  • meaningful parameterlist

Why includeonly/onlyinclude?

The effective content in my templates is strictly embedded in <includeonly><onlyinclude></onlyinclude></includeonly> tags. Why is that? A template should not effect itself, e.g. when embedding pages are categorized you usually do not want the template to be added to the category.

Compact

All the template documentation is displayed on the template page itself without requiring additional testing pages.

Up-to-date

One of the problems of documention of software is to keep it up-to-date. Whenever the template is changed the documentation has to be adapted. The documentation via the lua module Template documentation does this without any additional work. When a template is changed the effects of the change are immediately displayed on the template wiki page even as preview.

Parameterlist

The list of parameters is displayed as table which contains parameter name, meaning and default. Additionally it is marked as optional or mandatory. Obviously there is no other way than to enter this informations manually.

When a parameterlist is entered, the documentation displays a text for copy&paste.

Transparent

When you edit a wikipage you can see the raw text. When you transclude a template you can see the effect. This requires several mouseclicks and browser tabs. Checking and comparing is exhausting. Module Template documentation provides any of this on one singel page, the template page itself, and it is updating self-acting.

There are (at least) three levels of wikitext: the raw content in the template itself, the wikitext in the transcluding page and the rendered wikitext.

The documentation via the lua module Template documentation shows all of them on one page without additional mouseclicks.

Description

A short description (what is the purpose, what are the requirements, which namespace to use..) should be entered and explain what the template actually does.

Multiple application cases

A good documentation can show different application cases at the same time on the same page and is updating itself.

Conclusion

For a template documentation with module Template documentation a meaningful description and the parameterlist have to be entered by hand, eveything else is automated. The template documentation is included from a subpage which is named doc by default.

Every template page looks similar containing the following elements:

  • linkbox to editing and several page information
  • linkbox for the documentation subpage
  • parameterlist
  • copy&paste text
  • application (default without parameters - can be suppressed, up to 10 different cases with parameters)
  • raw text
  • links to usage
  • list of subpages

To Do

It is not possible to enter a page name as in the special page Vorlagen expandieren.