Module:Annotated link/doc: Difference between revisions

Content deleted Content added
I need more tea or I'll pass out before this is done...
something like that; I'm not in the best condition to proofread effectively, but it's not offensive
Line 22:
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. 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 offor [[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).
Line 85:
 
=== desc_first_letter_case ===
Since Module:GetShortDescription could return a description from wikidata, which are formatted with a lowercase first letter, whereas [[WP:SDFORMAT|short descriptions]] on en Wikipedia are formatted with an uppercase first letter, and simply to give control over that display to the editor; stating either {{para|desc_first_letter_case|upper}} or {{para|desc_first_letter_case|lower}} will set the first character accordingly:
 
Explicitly requesting the wikidata description for an entity (to be explained in [[#Module:GetShortDescription parameters]] (below)) will append an inappropriately formatted description:
 
'''Markup:''' <code><nowiki>{{#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 }}</nowiki></code>
 
'''Result:''' {{#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 }}
 
By stating {{para|desc_first_letter_case|upper}} the module resolves that issue:
 
'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLink|main |name=The Partisan |quote=yes |only=wikidata |desc_first_letter_case=upper }}</nowiki></code>
 
'''Result:''' {{#invoke:AnnotatedLink|main|name=The Partisan|quote=yes|only=wikidata|desc_first_letter_case=upper}}
 
=== Module:GetShortDescription parameters ===
{{main|Module:GetShortDescription/doc}}
ThisThe parametervalue 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
''' name '''
value to find a {{tlx|short description}} in the named page, or various alternatives depending on parameter values.
This parameter is passed through this module to Module:GetShortDescription where it is also '''required'''; the expectations are described in [[#name]] (above).
 
==== only ====
StatingProviding 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 [[#Fallbackfallback]] (below).
 
Stating {{para|only|explicit}} will limit the search to only short descriptions set by use of {{tlc|short description}} on the searched page.
''' explicit '''
 
Stating {{para|only|wikidata}} will limit the search to only wikidata descriptions.
''' wikidata '''
 
==== prefer ====
StatingProviding 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 [[#Fallbackfallback]] (below).
 
State {{para|prefer|explicit}} to use the explicit short description if available, or try for the wikidata description if not.
''' explicit or wikidata '''
 
State {{para|prefer|wikidata}} to use the wikidata description if available, or try for an explicit short description if not.
''' wikidata or explicit '''
 
==== fallback ====
If a {{para|fallback}} value is provided, and no description is found by the expressed route, the resultappended description will be the stated fallback value.
 
''' only or fallback '''
 
''' prefer or fallback '''
 
=== Foreign language text ===
Module:GetShortDescription may return a foreign language wikidata description; editor discretion determines if that should be displayed. If it is displayed; it will be in accordance with [[MOS:OTHERLANG]], by [[Module:Lang]] (the module powering {{tlx|lang}}). The appropriate language code will be set automatically, but all other parameters of {{tlc|lang}} are available to affect the formatting of the returned description:
 
The parameters for {{tlc|lang}} may be provided via: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.
=== link_lang ===
 
{{para|link_lang}} ... {{para|link_lang_italic}}, {{para|link_lang_nocat}}, {{para|link_lang_size}}, {{para|link_lang_cat}}, {{para|link_lang_rtl}}
 
=== aka_lang ===
 
{{para|aka_lang_italic}}, {{para|aka_lang_nocat}}, {{para|aka_lang_size}}, {{para|aka_lang_cat}}, {{para|aka_lang_rtl}}
 
=== wedge_lang ===
 
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.
{{para|wedge_lang_italic}}, {{para|wedge_lang_nocat}}, {{para|wedge_lang_size}}, {{para|wedge_lang_cat}}, {{para|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 {{tlx|lang}} by default; this may be disabled with {{para|lang_no|yes}}.
 
==== link_lang ====
The parameters for {{tlc|lang}} may be provided via: {{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 link text is of a foreign language (again; editor discretion); control the formatting with: {{para|link_lang|<language code>}} ..., {{para|link_lang_italic}}, {{para|link_lang_nocat}}, {{para|link_lang_size}}, {{para|link_lang_cat}}, and {{para|link_lang_rtl}}
 
==== aka_lang ====
'''Markup:''' <code><nowiki>{{#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 }}</nowiki></code>
If the {{para|aka}} text is of a foreign language (again; editor discretion); control the formatting with: {{para|aka_lang|<language code>}}, {{para|aka_lang_italic}}, {{para|aka_lang_nocat}}, {{para|aka_lang_size}}, {{para|aka_lang_cat}}, {{para|aka_lang_rtl}}
 
==== wedge_lang ====
'''Result:''' {{#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 }}
If the {{para|wedge}} text is of a foreign language (again; editor discretion); control the formatting with: {{para|wedge_lang|<language code>}}, {{para|wedge_lang_italic}}, {{para|wedge_lang_nocat}}, {{para|wedge_lang_size}}, {{para|wedge_lang_cat}}, {{para|wedge_lang_rtl}}
 
<includeonly>{{Sandbox other||