Template:Dochead/doc

Revision as of 22:49, 23 October 2025 by Ganaram inukshuk (talk | contribs) (update doc)
This template is implemented by the Lua module Module:Dochead.
This template invokes the following functions: dochead from Dochead.

This template automatically categorizes documentation by namespace, which eliminates the need to do this manually. Currently, it is configured to place templates, modules, and their documentation inside their respective categories:

Usage

This template is invoked by placing {{dochead}} at the top of a module or template's /doc subpage.

For templates, header options are as follows:

  • metatemplate: Note: This template is used to build other templates and should not be used standalone except for testing and simple usage.

For modules, header options are as follows:

  • metamodule: Note: This module primarily provides functionality for other Lua modules and cannot be invoked by templates.
  • dualuse: Note: This module may be invoked by templates using Template:{{ROOTPAGENAME}}, or used directly from other modules.
  • noinvoke (default): Note: This module provides functionality to a template and should not be invoked directly; use the corresponding template instead: Template:{{ROOTPAGENAME}}.

In either case, passing in header=none results in no message being displayed. A custom message may also be passed in.

The "magic word" ROOTPAGENAME returns the name of the page without the namespace or subpages. By default, Lua modules that implement templates provide a link to a template of the same name. If this name is different, it can be passed in using temp=Template name goes here.

See also

Todo: update documentation

Dochead should now be able support categories on both templates and modules. Now contains new default messages that came up a lot that the single "use this module's corresponding template" message cannot capture.