Bureaucrats, Moderators (CommentStreams), Interface administrators, Push subscription managers, Suppressors, Administrators
12,446
edits
| Line 30: | Line 30: | ||
1. Create the Documentation Subpage: | 1. Create the Documentation Subpage: | ||
* Navigate to `Template:<TemplateName>/doc` (e.g., `Template:Infobox saint/doc`). | |||
* If it doesn’t exist, create the page by editing it. | |||
* Add `{{tlx|Documentation subpage}}` at the top. | |||
2. Structure the Documentation: | 2. Structure the Documentation: | ||
Use the following standard format: | |||
* Purpose: Describe what the template does (e.g., “Displays a standardized infobox for saint biographies”). | |||
* Usage: Provide the basic syntax (e.g., `{{tlx|TemplateName|parameter1|parameter2}}`). | |||
* Parameters: List all parameters, their purpose, and whether they are optional or required. Use a table or bullet points for clarity. | |||
* Examples: Show how the template renders with sample inputs. | |||
* Notes: Highlight dependencies (e.g., Cargo tables, specific extensions), common issues, or styling tips. | |||
Example structure for `Template:Infobox saint/doc`: | |||
<pre> | |||
{{tlx|Documentation subpage}} | {{tlx|Documentation subpage}} | ||
== Purpose == | == Purpose == | ||
| Line 54: | Line 57: | ||
== Parameters == | == Parameters == | ||
* name – The saint’s name (required). | |||
* feast_day – The saint’s feast day (optional). | |||
* patronage – Areas or groups the saint is patron of (optional). | |||
== Example == | == Example == | ||
| Line 67: | Line 70: | ||
== Notes == | == Notes == | ||
* Ensure dates follow Saintapedia’s style guide (e.g., “October 4” not “4 October”). | |||
* Use Cargo queries for dynamic fields like parish lists, if applicable. | |||
[[Category:Template documentation]] | [[Category:Template documentation]] | ||
</pre> | </pre> | ||
3. Link to Documentation: | 3. Link to Documentation: | ||
* Add `{{tlx|Documentation}}` to the bottom of the template page (e.g., `Template:Infobox saint`) to display the documentation subpage content. | |||
* Use `<noinclude>{{tlx|Documentation}}</noinclude>` to ensure it only appears on the template page, not where the template is transcluded. | |||
4. Use VisualEditor or Wikitext: | 4. Use VisualEditor or Wikitext: | ||
* Saintapedia supports VisualEditor for ease of use, but wikitext is recommended for precise control in template documentation. | |||
* Use “Show preview” to check formatting before saving. | |||
5. Test Changes: | 5. Test Changes: | ||
* Create a sandbox (e.g., `Template:<TemplateName>/sandbox`) to test template modifications. | |||
* Use testcases (e.g., `Template:<TemplateName>/testcases`) to compare outputs. | |||
* Verify functionality on a test page before applying changes to live templates. | |||
== Best Practices == | == Best Practices == | ||