Module:Main/doc
More actions
This is the documentation page for Module:Main
This is a documentation subpage for Main. It contains usage information, categories, and other content that is not part of the original template.
This module backs {{Main}}, the hatnote pointing readers to the main article or articles on a topic. It takes any number of page-name arguments and renders them as a list with proper comma and "and" separators (no Oxford comma) and a label that pluralises with the count.
Usage
The module is invoked from {{Main}}:
{{#invoke:Main|main}}
End users do not call the module directly. They use the template:
{{Main|Page name}}
{{Main|First page|Second page}}
{{Main|First page|Second page|Third page}}
Parameters
- Positional arguments (1, 2, 3, ...)
- Page-name targets for the hatnote links. At least one is required; there is no fixed upper limit. Empty trailing arguments stop the scan.
l1,l2,l3, ...- Optional display labels for the corresponding positional argument.
l2=foosets the display text for the second positional argument. If omitted, the page name is shown as the link text.
Output
Renders a single div with classes main-article-hatnote navigation-not-searchable and ARIA role note. Styled by Template:Main/styles.css.
Label:
- one target:
Main article: - two or more targets:
Main articles:
Separators between targets:
- two targets:
A and B - three or more:
A, B and C(no Oxford comma)
Examples
| Input | Renders as |
|---|---|
{{Main|Cannabis in West Bengal}}
|
Main article: Cannabis in West Bengal |
{{Main|Cannabis in West Bengal|Religion in West Bengal}}
|
Main articles: Cannabis in West Bengal and Religion in West Bengal |
{{Main|Cannabis in West Bengal|Religion in West Bengal|Cuisine of West Bengal}}
|
Main articles: Cannabis in West Bengal, Religion in West Bengal and Cuisine of West Bengal |
{{Main|Cannabis in West Bengal|l1=cannabis here}}
|
Main article: cannabis here |
When to use
At the top of a section whose subject has a dedicated main article. The hatnote tells the reader the section is a summary and points to fuller treatment elsewhere.
Aggressive deferral via {{Main}} is the standard pattern for hub articles (Cannabis cultivation, Cannabis Botany, country pages). Each body section gives two to four sentences plus a {{Main}} link to the subarticle.
When not to use
Not for a list of merely related pages: that's [[Template:See also|{{See also}}]] (where the link is tangential rather than the section's main subject).
Not for further reading on a subtopic that the section itself covers in full: that's the pattern for [[Template:Further|{{Further}}]].
Not in a lead, except in rare cases where the article itself is a summary stub pointing to a fuller article elsewhere. Lead hatnotes are usually [[Template:About|{{About}}]]-style disambiguation rather than main-article pointers.
Styling
Visual treatment lives in Template:Main/styles.css:
- italic body text
- normal-style links inside (italic stripped)
- 0.95em font size
- 1.6em left margin (hatnote indent)
- colour inherits from the article body, so the hatnote sits with surrounding prose
To change colour, font size, or indent globally, edit Template:Main/styles.css. The module's output is class-scoped so changes do not affect other hatnote templates.
See also
{{Citation needed}}– inline editorial tag{{Original research}}– inline editorial tag{{Page stub}},{{Section stub}}– stub notices