Template:Anchor/doc: Difference between revisions
Template page
More actions
clean up TemplateData, link to module |
m Fix Linter errors. |
||
| Line 30: | 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 = | ||