NeuroWiki:Template Standards

- The guidelines text describes the binding operational methods and standards currently in effect on NeuroWiki;
- Users are expected to adhere to the content described on this page;
- The Site Owner of NeuroWiki reserve the final interpretation rights for all provisions.
Core Principles
- Functionality First: Avoid creating templates with overlapping functionality.
- Low Resource Consumption: Template rendering time must be <200ms.
- Semantic Naming: Template names should be related to their actual functions. Use English names for pages, and localized redirects are allowed.
- Mandatory Documentation: All templates must include usage instructions.
Template Categories
Category Prefix | Purpose | Example | Permission Requirements |
---|---|---|---|
Info/ |
Page-level info boxes | {{Info/DeprecatedContent}} | Auto-confirmed users |
Nav/ |
Navigation templates | {{Nav/LivestreamRecords}} | |
Infobox/ |
Detailed information box templates | {{Infobox/Character}} | |
System/ |
System-level templates | {{System/ProtectionNotice}} | Administrators or senior administrators only |
Naming Standards
- Use the "Purpose_Object" structure:
- Correct:{{Info/Citation}}
- Incorrect:{{BlueCitationBox}}
- For multilingual versions, use language prefixes:
- Chinese:Template:Nav/直播记录
- English:Template:Nav/Livestream
Technical Standards
Parameter Design
- Required parameters should use the format
{{{1}}}
. - Optional parameters should have semantic names:
- Correct:{{{color|#36c}}}
- Incorrect:{{{2}}}
- Nesting levels should not exceed 3 (optimize using
{{subst:}}
).
Performance Limits
Metric | Threshold | Detection Tool |
---|---|---|
Parse Time | <200ms | |
Memory Usage | <2MB | mw:Help:ResourceLoader |
Invocation Count | <50 per page | mw:Extension:TemplateWarn |
Documentation Requirements
- Documentation must include the following sections:
```mediawiki == Function Description == == Parameter List == {| class="wikitable" ! Parameter !! Type !! Description |- | {{{1}}} || Required || Main content |} == Usage Example == {{Test/ExampleTemplate | parameter1 = value }}
|