Module:Annotated link/doc
| This is a documentation subpage for Module:Annotated link. It may contain usage information, categories and other content that is not part of the original module page. |
| This module is rated as pre-alpha. It is incomplete and may or may not be in active development. Do not use it in article namespace pages. A module remains in pre-alpha until its developer, or another editor who adopts it if it is abandoned for some time, considers the basic structure complete. |
| This module depends on the following other modules: |
Usage
{{#invoke:AnnotatedLink|main
|name= |display= |quote= |abbr= |aka= |wedge= |dash= |desc_first_letter_case=
|link_lang= |link_lang_italic= |link_lang_nocat= |link_lang_size= |link_lang_cat= |link_lang_rtl=
|wedge_lang= |wedge_lang_italic= |wedge_lang_nocat= |wedge_lang_size= |wedge_lang_cat= |wedge_lang_rtl=
|aka_lang= |aka_lang_italic= |aka_lang_nocat= |aka_lang_size= |aka_lang_cat= |aka_lang_rtl=
|only= |prefer= |fallback=
|desc_lang_italic= |desc_lang_nocat= |desc_lang_size= |desc_lang_cat= |desc_lang_rtl= |desc_lang_no=
}}
name
By providing only the required page name (including namespace), the module will use Module:GetShortDescription to look for an explicit {{short description}} in that page, but if not found, will try to fetch the wikidata description. If a description is found, it will be appended to a link created for the named page in the style expected for the likes of MOS:SEEALSO. If no description is found, the link will be created but no extra information will be appended – unless the extensive following parameters are employed.
Any foreign language text supplied to or retrieved by this module can be appropriately formatted, in accordance with MOS:OTHERLANG, via the parameters of Module:Lang; see #Foreign language text (below).
As this module is responsible for the use of all features of Module:GetShortDescription; all the parameters for that module are available through this module; see #Module:GetShortDescription parameters (below).
Markup: {{#invoke:AnnotatedLink|main |name=The Partisan }}
Result: Script error: No such module "AnnotatedLink".
This and the following example song titles should be double quoted per MOS:POPMUSIC; that will be handled by #quote (below).
display
Providing a value for |display= will format the piped link with a display string:
Markup: {{#invoke:AnnotatedLink|main |name=Jump (Every Little Thing song) |display=Jump }}
Result: Script error: No such module "AnnotatedLink".
quote
Stating |quote=yes will double quote the link:
Markup: {{#invoke:AnnotatedLink|main |name=The Partisan |quote=yes }}
Result: Script error: No such module "AnnotatedLink".
Markup: {{#invoke:AnnotatedLink|main |name=Jump (Every Little Thing song) |display=Jump |quote=yes }}
Result: Script error: No such module "AnnotatedLink".
abbr
Providing a value for |abbr= will append the link with the provided parenthesized abbreviation:
Markup: {{#invoke:AnnotatedLink|main |name=Confédération Mondiale des Activités Subaquatiques |display=World Underwater Federation |abbr=CMAS }}
Result: Script error: No such module "AnnotatedLink".
aka
Providing a value for |aka= will append the link (and |abbr= if provided) with a useful alternative name:
Markup: {{#invoke:AnnotatedLink|main |name=The Partisan |quote=yes |aka=La Complainte du partisan }}
Result: Script error: No such module "AnnotatedLink".
Markup: {{#invoke:AnnotatedLink|main |name=Confédération Mondiale des Activités Subaquatiques |display=World Underwater Federation |abbr=CMAS |aka=Confédération Mondiale des Activités Subaquatiques }}
Result: Script error: No such module "AnnotatedLink".
These and some following examples contain foreign language text that, per MOS:OTHERLANG, should be appropriately displayed and declared via HTML markup as being of that language; this will be handled by various parameters; see #Foreign language text (below) for full details, but you will see the parameters in use where appropriate from now on.
wedge
Providing a value for |wedge= will append the link (and |abbr= and |aka= in that order if either or both is provided) with any extra details felt suitable:
Markup: {{#invoke:AnnotatedLink|main |name=The Partisan |quote=yes |wedge=from the album ''[[Songs from a Room]]'' |aka=La Complainte du partisan |aka_lang=fr }}
Result: Script error: No such module "AnnotatedLink".
dash
For list consistency, per MOS:LISTFORMAT; by providing a value for |dash=; the dash between the short description and the preceding text may be exchanged for a suitable alternative:
Markup: {{#invoke:AnnotatedLink|main |name=The Partisan |dash=, }}
Result: Script error: No such module "AnnotatedLink".
desc_first_letter_case
Module:GetShortDescription parameters
name This parameter is passed through this module to Module:GetShortDescription where it is also required; the expectations are described in #name (above).
only
Stating |only= will limit the search to being only for the stated description. If no description is found, the result will be an empty string, unless a fallback is provided; see #Fallback (below).
explicit
wikidata
prefer
Stating |prefer= will initiate the search for the stated description, but try for the alternative if none is found. If no description is found, the result will be an empty string, unless a fallback is provided; see #Fallback (below).
explicit or wikidata
wikidata or explicit
fallback
If a |fallback= is provided, and no description is found by the expressed route, the result will be the stated fallback.
only or fallback
prefer or fallback
Foreign language text
link_lang
|link_lang= ... |link_lang_italic=, |link_lang_nocat=, |link_lang_size=, |link_lang_cat=, |link_lang_rtl=
aka_lang
|aka_lang_italic=, |aka_lang_nocat=, |aka_lang_size=, |aka_lang_cat=, |aka_lang_rtl=
wedge_lang
|wedge_lang_italic=, |wedge_lang_nocat=, |wedge_lang_size=, |wedge_lang_cat=, |wedge_lang_rtl=
Should a wikidata description be retrieved, which is declared (at the source) as being of a foreign language (i.e. not en), the return will be wrapped in {{lang}} by default; this may be disabled with |lang_no=yes.
The parameters for {{lang}} may be provided via: |lang_italic=, |lang_nocat=, |lang_size=, |lang_cat= and |lang_rtl=; see lang's documentation for details.
Markup: {{#invoke:AnnotatedLink|main |name=The Partisan |quote=yes |only=wikidata |desc_first_letter_case=upper |wedge=from the album ''[[Songs from a Room]]'' |aka=La Complainte du partisan |aka_lang=fr }}
Result: Script error: No such module "AnnotatedLink".