This template should always be substituted (i.e., use {{subst:AnnotatedListOfLinks}} ). |
This template uses Lua: |
When substituted, AnnotatedListOfLinks wraps the {{Annotated link}}
template around un-annotated wikilinks in a list. It's designed to avoid clobbering existing descriptions so it can be placed around mixed content without much concern. One notable exception is the loss of HTML-style comments. The expected common use is for quickly updating "See also" sections while making sure to respect prior manual edits.
{{subst:AnnotatedListOfLinks|
<!-- mixed wikitext (including headings, comments, templates) -->
== See Also ==
{{Portal|example}}
* [[Standard links]]
* [[Piped links|Pipers]]
* [[Generic Links]] - links that require more context than just the text
* {{Annotated link |Good Articles}}
* [[More links]]
* [[File:Some_photo_from_1944]]
<!-- though the File: example would be unusual -->
Followup prose with [[embedded links]] to other things.
}}
When applied as above, the resulting wikitext is as follows:
== See Also ==
{{Portal|example}}
* {{Annotated link |Standard links}}
* {{Annotated link |Piped links|Pipers}}
* [[Generic Links]] - links that require more context than just the text
* {{Annotated link |Good Articles}}
* {{Annotated link |More links}}
* [[File:Some_photo_from_1944]]
Followup prose with [[embedded links]] to other things.
The net result is that three links have been updated to use the {{Annotated link}}
template, two HTML-style comments have been removed, and the other wikitext has remained unchanged.
{{Annotated link}}
. Filling in missing descriptions is an easy way to help other editors understand what the template does. It also really helps out WP:WPSD.This template only updates a link if all these criteria are met
[[Special: Random]]
will not be changed).[[T]]
)Links that meet those criteria are updated regardless of whether the target article already has a WP:WPSD or not with the understanding that when one is added, it will be correctly rendered by the {{Annotated link}}
template. This means some edits with this template will initially appear to have no effect. You can fix this by visiting any article which needs a description and writing it for the target page. Also note that links targeting redirect pages will be updated but may show a different WP:WPSD than the target page since each can have their own description. This can be confusing to editors who check for SD consistency between annotated links and their target but it is generally not a problem for readers since articles do not include the description as part of the rendered content. Readers, in other words, will only see the SD for the redirect page, not the target page.
Comments passed through this template will be removed and should be re-added manually in a subsequent edit if they are desired. Alternatively, relocate important comments outside the template before substitution to preserve them.
These are unlikely to change
:
) in the target or substituted text: Looking for a colon is the mechanism used to avoid changing non-article namespace links.Transcluding this template has no effect. It would be technically possible to write the template in such a way that it accomplished the same thing using transclusion but this was avoided mostly in an effort to borrow the WP:Principle of least astonishment for use in the context of editing wikitext. It's unusual for templates to perform selective parsing of wikitext which is essentially what this one does: certain links get parsed and others do not. This might lead to editors modifying the wikitext used within the template and seeing unexpected results. Using substitution allows the template code to plop {{Annotated link}}
templates specifically where they are needed making it clear which parts of the wikitext source are being supplemented and which are not.
Another benefit of substitution is display consistency with the "Annotated link" template. Transcluding would require re-implementing the rendering of WP:Short descriptions into HTML output, and in the long term, might lead to slight differences between links rendered with this template and with individual annotated links. Substitution avoids that potential diversion.
Finally, substitution reduces the familiarity burden on future wikitext editors. Substituting the template leaves no trace of the template's name in the subsequent edit. Although it sounds problematic it actually has a subtle benefit: although editors who use this template need to know what it does, editors encountering the results of this template only need to have knowledge of {{Annotated link}}
to understand the final output. In effect, it helps direct other wikitext editors to that template instead of this one.
{{Annotated link}}
. The actual redirect page needs to have its own description as well or it will register as blank. Generally this is preferred because descriptions may vary slightly in the choice of words that best describe the same subject by alternate names.