Template:Doc/doc

From Grand Theft Wiki
Jump to navigation Jump to search

This template automatically displays a documentation box like you are seeing now, of which the content is transcluded from another page. It is intended for pages which are transcluded in other pages, i.e. templates, whether in the template namespace or not.

Usage

Normal /doc

<noinclude>{{Documentation}}</noinclude>

Any /doc page

<noinclude>{{Documentation|Template:any page/doc}}</noinclude>

In-line content

<noinclude>{{Documentation|content=This is documentation.}}</noinclude>

In-line content with [view][edit] links

<noinclude>{{Documentation
|1 = Template:any page/doc
|content ={{Template:any page/doc|parameters}}
}}</noinclude>

Best practice

This code should be added at the bottom of the template code, with no extra space before "<noinclude>" (which would cause extra space on pages where the template is used). The parameter can be used as shown above to transclude an arbitrary documentation page.

Categories and interwiki links that apply to the template itself should be added to the documentation page, inside <includeonly> </includeonly> tags. For more complex cases, see Wikipedia:Template documentation#Categories and interwiki links.

If the documentation page contains includeonly or noinclude tags as part of the documentation, replace the "<" with "&lt;".

Customizing display

Overrides exist to customize the output in special cases:

  • {{documentation| heading = ...}} − change the text of the "documentation" heading. If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.

Functions

If the documentation page doesn't exist, the "edit" link includes a preload parameter so that clicking it will pre-fill the edit form with the basic documentation page format.

Rationale

Use of this template allows templates to be protected where necessary, while allowing anyone to edit the documentation, categories, and interwiki links.
https://www.grandtheftwiki.com/Template:Doc/doc
www.grandtheftwiki.com
crawl=CC-MAIN-2022-05
24627
application/http; msgtype=response
sha1:LIQD6ZFT2X2GOQG32LNHDGMMJQH7SWOU
<urn:uuid:77f235d5-9ea9-483f-bde7-7288c2ce3f6f>
2022-01-25T14:14:16Z
172.66.43.33
text/html
sha1:HJPWQRZR3Q2X5UCFAMHDEHNHJX5EJ5ES
<urn:uuid:0b5f0e18-1eb6-49d2-bf88-b80ba7b12792>
https://www.grandtheftwiki.com/Template:Doc/doc
response
<urn:uuid:10ccfc92-3112-4208-9601-4bf69e6746cc>
isPartOf: CC-MAIN-2022-05
publisher: Common Crawl
description: Wide crawl of the web for January 2022
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-95
software: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.3-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/