Template:Anchor comment/doc: Difference between revisions
m Reverted edits by 2600:387:C:7019:0:0:0:5 (talk) (HG) (3.4.10) |
→Example: Template:Anchor should be substituted in section headings, for the same reason as the current template. Let's set a good example, y'all. |
||
Line 19: | Line 19: | ||
This |
This |
||
<code><nowiki> {{Anchor|Polysulfide_shuttle|Polysulfide_|Polysulfide shuttle}} |
<code><nowiki> {{subst:Anchor|Polysulfide_shuttle|Polysulfide_|Polysulfide shuttle}} |
||
{{subst:Anchor comment}} <!-- Second anchor makes (defective) link from https://arstechnica.com/science/2020/01/will-lithium-sulfur-batteries-be-in-our-future/ work.--> </nowiki></code> |
{{subst:Anchor comment}} <!-- Second anchor makes (defective) link from https://arstechnica.com/science/2020/01/will-lithium-sulfur-batteries-be-in-our-future/ work.--> </nowiki></code> |
||
Line 25: | Line 25: | ||
<code><nowiki> |
<code><nowiki> |
||
<span class="anchor" id="Polysulfide_shuttle"></span><span class="anchor" id="Polysulfide_"></span><span class="anchor" id="Polysulfide shuttle"></span> |
|||
<!-- This Anchor tag serves to provide a permanent target for incoming section links. Please do not remove it, nor modify it, except to add another appropriate anchor. If you modify the section title, please anchor the old title. It is always best to anchor an old section header that has been changed so that links to it will not be broken. See [[Template:Anchor]] for details. This template is {{subst:Anchor comment}} --><!-- Second anchor makes (defective) link from https://arstechnica.com/science/2020/01/will-lithium-sulfur-batteries-be-in-our-future/ work.--> |
<!-- This Anchor tag serves to provide a permanent target for incoming section links. Please do not remove it, nor modify it, except to add another appropriate anchor. If you modify the section title, please anchor the old title. It is always best to anchor an old section header that has been changed so that links to it will not be broken. See [[Template:Anchor]] for details. This template is {{subst:Anchor comment}} --><!-- Second anchor makes (defective) link from https://arstechnica.com/science/2020/01/will-lithium-sulfur-batteries-be-in-our-future/ work.--> |
||
</nowiki></code> |
</nowiki></code> |
Revision as of 06:45, 9 January 2022
![]() | This is a documentation subpage for Template:Anchor comment. It may contain usage information, categories and other content that is not part of the original template page. |
![]() | This template should always be substituted (i.e., use {{subst:Anchor comment}} ). |
Result
<!-- This Anchor tag serves to provide a permanent target for incoming section links. Please do not remove it, nor modify it, except to add another appropriate anchor. If you modify the section title, please anchor the old title. It is always best to anchor an old section header that has been changed so that links to it will not be broken. See [[Template:Anchor]] for details. This template is {{subst:Anchor comment}} -->
Usage
Substitute this template immediately beneath any anchor or section heading that contains an in-line {{anchor}} to alert other editors to its purpose.
The reason to use this template underneath section anchors is twofold:
- To prevent editors from moving the {{anchor}} placement in an effort to avoid edit summary obfuscation. Any edit summary can be altered directly while making it to furnish more space for a longer summary;
- To prevent editors from changing the contents of the anchor tag if they change the name of the section, in an assumption that they must continue to match. More anchors may be added to the Anchor template if needed:
{{Anchor|(first anchor)|(second anchor)|(and so on)}}
See the Anchor template for more details.
Example
This
{{subst:Anchor|Polysulfide_shuttle|Polysulfide_|Polysulfide shuttle}}
{{subst:Anchor comment}} <!-- Second anchor makes (defective) link from https://arstechnica.com/science/2020/01/will-lithium-sulfur-batteries-be-in-our-future/ work.-->
inserts the following:
<span class="anchor" id="Polysulfide_shuttle"></span><span class="anchor" id="Polysulfide_"></span><span class="anchor" id="Polysulfide shuttle"></span>
<!-- This Anchor tag serves to provide a permanent target for incoming section links. Please do not remove it, nor modify it, except to add another appropriate anchor. If you modify the section title, please anchor the old title. It is always best to anchor an old section header that has been changed so that links to it will not be broken. See [[Template:Anchor]] for details. This template is {{subst:Anchor comment}} --><!-- Second anchor makes (defective) link from https://arstechnica.com/science/2020/01/will-lithium-sulfur-batteries-be-in-our-future/ work.-->
See also
- {{Visible anchor}}