Template:Anchor/doc: Difference between revisions
Template page
More actions
add description, use TemplateData, remove dead interlanguage link |
Fix language-code links to use Wikipedia interwiki prefixes |
||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{Lua|Module:Anchor}} | |||
{{TemplateBox | {{TemplateBox | ||
|1 = anchor | |1 = 1 | ||
|1d-en = The text that will be the anchor | |1aliases = anchor | ||
|1label-en= First anchor | |||
|1d-en = The text that will be the first anchor | |||
|1type = | |1type = line | ||
|1def = | |1def = | ||
|1stat = required | |1stat = required | ||
|2 = 2 | |||
|2label-en= Second anchor | |||
|2d-en = The text that will be the second anchor | |||
|2type = line | |||
|2def = | |||
|2stat = optional- | |||
|3 = 3 | |||
|3label-en= Third anchor | |||
|3d-en = The text that will be the third anchor | |||
|3type = line | |||
|3def = | |||
|3stat = optional- | |||
|name = anchor | |name = anchor | ||
|desc-en = This template creates an anchor where it is placed, that is, a point which can be linked like a section header either from somewhere within that page, another Commons page, or another website. It has no visual output. | |desc-en = This template creates an anchor where it is placed, that is, a point which can be linked like a section header either from somewhere within that page, another Commons page, or another website. It has no visual output. (This template documentation lists three parameters, but you may use virtually any number of unnamed parameters for more anchors.) | ||
|namespace = all | |namespace = all | ||
|usergroup = all | |usergroup = all | ||
| Line 15: | Line 30: | ||
|usage-notes = | |usage-notes = | ||
1. <code style="color:green;"><nowiki>{{anchor|foo}}</nowiki></code> | 1. <code style="color:green;"><nowiki>{{anchor|foo}}</nowiki></code> | ||
: could be linked to with < | : could be linked to with <code><nowiki>[[#foo|...]]</nowiki></code> from within the same article, | ||
: or it could be linked to with < | : or it could be linked to with <code><nowiki>[[</nowiki>''<small>articlename</small>''#foo<nowiki>|…]]</nowiki></code> from other articles and from redirects. | ||
2. Anchors can be more suitable for inter-article linking than section titles are. For example, | 2. Anchors can be more suitable for inter-article linking than section titles are. For example, | ||
:<code style="color:green;"><nowiki>=={{anchor|foo}}</nowiki></code><code style="color:gray;"> Section title <nowiki>==</nowiki></code> | :<code style="color:green;"><nowiki>=={{anchor|foo}}</nowiki></code><code style="color:gray;"> Section title <nowiki>==</nowiki></code> | ||
:Here, links via < | :Here, links via <code><nowiki>[[</nowiki>''articlename''#foo<nowiki>]]</nowiki></code> would remain valid even if the section were renamed. | ||
|type = | |type = | ||
|example = | |example = | ||
| Line 32: | Line 47: | ||
|print = | |print = | ||
|shorthand = | |shorthand = | ||
|relieson = | |relieson = [[Module:Anchor]] | ||
|mustbesubst = | |mustbesubst = | ||
|useTemplateData = only | |useTemplateData = only | ||
| Line 39: | Line 54: | ||
[[Category:Internal link templates]] | [[Category:Internal link templates]] | ||
[[eo:Ŝablono:Ankro2]] | [[w:eo:Ŝablono:Ankro2]] | ||
[[ja:Template:Anchor]] | [[w:ja:Template:Anchor]] | ||
</includeonly> | </includeonly> | ||