Module:Annotated link/doc: Difference between revisions

Content deleted Content added
updated module name
Line 5:
 
== Usage ==
<pre><nowiki>{{#invoke:AnnotatedLinkAnnotated link|main
 
|name= |display= |quote= |abbr= |abbr_title= |template_link= |aka= |wedge= |dash= |desc_first_letter_case= |space_cat= |red_cat=
Line 27:
 
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:AnnotatedLinkAnnotated link|main |name=The Partisan }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|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), and you will see the parameters in use where appropriate from here on.
 
=== display ===
Providing a value for {{para|display}} will format the piped link with a display string:
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLinkAnnotated link|main |name=Jump (Every Little Thing song) |display=Jump |quote=yes }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|main|name=Jump (Every Little Thing song)|display=Jump|quote=yes}}
 
=== quote ===
Stating {{para|quote|yes}} will double quote the link:
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLinkAnnotated link|main |name=The Partisan |quote=yes }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|main|name=The Partisan|quote=yes}}
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLinkAnnotated link|main |name=Jump (Every Little Thing song) |display=Jump |quote=yes }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|main|name=Jump (Every Little Thing song)|display=Jump|quote=yes}}
 
=== 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:AnnotatedLinkAnnotated link|main |name=Confédération Mondiale des Activités Subaquatiques |display=World Underwater Federation |abbr=CMAS }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|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:AnnotatedLinkAnnotated link|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:AnnotatedLinkAnnotated link|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}}
 
=== template_link ===
If the linked page is in the [[WP:TEMPLATE|Template]] namespace; the link will be formatted in the manner expected by {{tlx|template link}}:
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLinkAnnotated link|main |name=Template:Annotated link }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|main|name=Template:Annotated link}}
Stating {{para|template_link|code}} will display the link formatted with {{tag|code}}:
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLinkAnnotated link|main |name=Template:Annotated link |template_link=code }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|main|name=Template:Annotated link|template_link=code}}
The previously described parameters – {{para|display}}, {{para|quote}}, {{para|abbr}} and {{para|abbr_title}} – and all foreign language link options under {{para|link_lang}} (see [[#Foreign language text]] (below)) will be ignored if the link is in the Template namespace.
 
Stating {{para|template_link|no}} will disable this special link formatting and the ignorance of the above-mentioned parameters:
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLinkAnnotated link|main |name=Template:Annotated link |template_link=no |display=Annotated link }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|main|name=Template:Annotated link|template_link=no|display=Annotated link}}
 
=== aka ===
Providing a value for {{para|aka}} will append the link (and {{para|abbr}} if provided) with a useful alternative name:
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLinkAnnotated link|main |name=The Partisan |quote=yes |aka=La Complainte du partisan }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|main|name=The Partisan|quote=yes|aka=La Complainte du partisan}}
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLinkAnnotated link|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:AnnotatedLinkAnnotated link|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, and you will see the parameters in use where appropriate from here on.
 
=== wedge ===
Providing a value for {{para|wedge}} will append the link (and {{para|abbr}} and {{para|aka}} in that order if either or both is provided) with any extra details felt suitable:
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLinkAnnotated link|main |name=The Partisan |quote=yes |wedge=from the album ''[[Songs from a Room]]'' |aka=La Complainte du partisan |aka_lang=fr }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|main|name=The Partisan|quote=yes|wedge=from the album ''[[Songs from a Room]]''|aka=La Complainte du partisan|aka_lang=fr}}
For complementary foreign language params; see [[#Foreign language text]] (below).
 
=== dash ===
For list consistency, per [[MOS:LISTFORMAT]]; by providing a value for {{para|dash}}; the dash between the short description and the preceding text may be exchanged for a suitable alternative:
:'''Markup:''' <code><nowiki>{{#invoke:AnnotatedLinkAnnotated link|main |name=The Partisan |quote=yes |dash=, }}</nowiki></code>
:'''Result:''' {{#invoke:AnnotatedLinkAnnotated link|main|name=The Partisan|quote=yes|dash=,}}
 
=== desc_first_letter_case ===