Template:Category handler/doc: Difference between revisions
use-case |
|||
| Line 31: | Line 31: | ||
By default, this metatemplate allows categories within the following namespaces: main, file, mediawiki, template, category, and module. Templates placed outside of those namespaces will not categorize those pages. Additionally, pages with the suffix /doc or /sandbox will not be categorized. | By default, this metatemplate allows categories within the following namespaces: main, file, mediawiki, template, category, and module. Templates placed outside of those namespaces will not categorize those pages. Additionally, pages with the suffix /doc or /sandbox will not be categorized. | ||
This metatemplate is meant primarily for templates used within those namespaces. Use of this metatemplate is not required for templates with basic categorizing rules, or templates meant to be placed within other namespaces such as the user namespace. Additionally, specialized templates meant for categorizing /doc pages are unable to work with this template. | This metatemplate is meant primarily for templates used within those namespaces. Use of this metatemplate is not required for templates with basic categorizing rules, or templates meant to be placed within other namespaces, such as the user namespace. Additionally, specialized templates, such as those meant for categorizing /doc pages, are unable to work with this template. | ||
=== Changing suppressed namespaces === | === Changing suppressed namespaces === | ||
| Line 43: | Line 43: | ||
Templates are sometimes added to template documentation, such as [[Template:Todo]], which categorizes that page under a specific todo-task. Typically, such templates are added to a template's /doc page to be transcluded onto that template's page, instead of within the <code><nowiki><noinclude></noinclude></nowiki></code> block of a template's page. | Templates are sometimes added to template documentation, such as [[Template:Todo]], which categorizes that page under a specific todo-task. Typically, such templates are added to a template's /doc page to be transcluded onto that template's page, instead of within the <code><nowiki><noinclude></noinclude></nowiki></code> block of a template's page. | ||
For example, adding <code><nowiki>{{Todo|inline=1|add documentation}}</nowiki></code> to a template's documentation adds that template to [[:Category:Todo:add documentation]], but a | For example, adding <code><nowiki>{{Todo|inline=1|add documentation}}</nowiki></code> to a template's documentation adds that template to [[:Category:Todo:add documentation]], but a naïve implementation of that template will also categorize that template's /doc subpage. | ||
<pre> | <pre> | ||
| Line 60: | Line 60: | ||
* Template:SomeTemplate/doc (template's documentation) | * Template:SomeTemplate/doc (template's documentation) | ||
Since this template suppresses categories on /doc subpages, this template to Template:Todo prevents it from categorizing the documentation page, meaning only Template:SomeTemplate is categorized. | Since this template suppresses categories on /doc subpages, adding this template to Template:Todo prevents it from categorizing the documentation page, meaning only Template:SomeTemplate is categorized. | ||
<pre> | <pre> | ||