Module:Annotated link/doc: Difference between revisions

Content deleted Content added
added |abbr_title= and details of |abbr= <abbr> tagging + ce
Line 5:
<pre><nowiki>{{#invoke:AnnotatedLink|main
 
|name= |display= |quote= |abbr= |abbr_title= |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=
 
|wedge_lang= |wedge_lang_italic= |wedge_lang_nocat= |wedge_lang_size= |wedge_lang_cat= |wedge_lang_rtl=
 
|only= |prefer= |fallback=
Line 20:
=== name ===
By providing only the '''required''' page name (including namespace), the module will use [[Module:GetShortDescription]] to look for an explicit {{tlx|short description}} in that page, but if not found, will try to fetch the wikidata description. This is equivalent to stating {{para|prefer|explicit}}; see [[#prefer]] (below). 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 this module or retrieved by this moduleModule:GetShortDescription canmay be appropriately formatted, in accordance with [[MOS:OTHERLANG]], via the parameters for [[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:''' <code><nowiki>{{#invoke:AnnotatedLink|main |name=The Partisan }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLink|main|name=The Partisan}}
This and the following example song titles should be double quoted per [[MOS:POPMUSIC]]; that will be handled by [[#quote]] (below), butand you will see the parameters in use where appropriate from here on.
 
=== display ===
Line 42:
 
=== abbr ===
Providing a value for {{para|abbr}} will append the link with the provided parenthesized abbreviation with {{tag|abbr}} [[semantic markup]]:
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLink|main |name=Confédération Mondiale des Activités Subaquatiques |display=World Underwater Federation |abbr=CMAS }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLink|main|name=Confédération Mondiale des Activités Subaquatiques|display=World Underwater Federation|abbr=CMAS}}
An optional {{para|abbr_title}} may be provided:
 
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLink|main |name=Confédération Mondiale des Activités Subaquatiques |display=World Underwater Federation |abbr=CMAS |abbr_title=Confédération Mondiale des Activités Subaquatiques }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLink|main|name=Confédération Mondiale des Activités Subaquatiques|display=World Underwater Federation|abbr=CMAS|abbr_title=Confédération Mondiale des Activités Subaquatiques}}
=== aka ===
Providing a value for {{para|aka}} will append the link (and {{para|abbr}} if provided) with a useful alternative name:
Line 52 ⟶ 54:
:'''Markup:''' <code><nowiki>{{#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 }}</nowiki></code>
:'''Result:''' {{#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}}
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, butand you will see the parameters in use where appropriate from here on.
 
=== wedge ===
Line 76 ⟶ 78:
=== Module:GetShortDescription parameters ===
{{main|Module:GetShortDescription/doc}}
The value provided with {{para|name}} is passed through this module to Module:GetShortDescription where it is also '''required'''; the expectations of this module are described in [[#name]] (above). Module:GetShortDescription uses the
value to find a {{tlx|short description}} in the named page, or various alternatives depending on parameter values.
Line 82 ⟶ 83:
==== only ====
Providing a value for {{para|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).
:Stating {{para|only|wikidataexplicit}} will limit the search to only wikidatashort descriptions set by use of {{tlc|short description}} on the searched page.
 
:Stating {{para|only|explicitwikidata}} will limit the search to only shortwikidata descriptions set by use of {{tlc|short description}} on the searched page.
 
Stating {{para|only|wikidata}} will limit the search to only wikidata descriptions.
 
==== prefer ====
Providing a value for {{para|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).
:State {{para|prefer|wikidataexplicit}} to use the wikidataexplicit short description if available, or try for anthe explicit shortwikidata description if not.
 
:State {{para|prefer|explicitwikidata}} to use the explicit shortwikidata description if available, or try for thean wikidataexplicit short description if not.
 
State {{para|prefer|wikidata}} to use the wikidata description if available, or try for an explicit short description if not.
 
==== fallback ====
Line 102 ⟶ 99:
Use {{para|lang_italic}}, {{para|lang_nocat}}, {{para|lang_size}}, {{para|lang_cat}} and {{para|lang_rtl}}; see [[Template:Lang/doc|lang's documentation]] for details.
 
If the editor determines that {{tlc|lang}} formatting is not appropriate; it may be disabled with {{para|lang_no|yes}}. The following {{tlc|lang}} formatting parameters are optional, so there is no off -switch required.
 
==== link_lang ====