Template:LinkText: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(add syntax examples)
No edit summary
Line 8: Line 8:
<br>
<br>
<div style="margin: 0; margin-right: 30px; margin-left: 30px; border: 1px solid #3399ff; padding: 1em 1em 1em 1em; background-color:#ddffdd">
<div style="margin: 0; margin-right: 30px; margin-left: 30px; border: 1px solid #3399ff; padding: 1em 1em 1em 1em; background-color:#ddffdd">
<center><big>'''Documentation'''</big><br></center>
<center><h3>Documentation</h3></center>


'''Syntax examples:'''
<h4>Default behavior</h4>
<pre>{{LinkText|Ave Maria}}
This template provides links for up to three text pages.  Its '''default behavior''' is to '''''italicize''''' all links ''except'' those that begin with '''Psalm''' as in:
<pre>{{LinkText|Ave verum corpus}}</pre>
producing
:{{LinkText|Ave verum corpus}}
<pre>{{LinkText|2|Psalm 131|Wachet auf, ruft uns die Stimme}}</pre>
producing (for two pages)
:{{LinkText|2|Psalm 131|Wachet auf, ruft uns die Stimme}}
and
<pre>{{LinkText|3|O magnum mysterium|Ave Maria|Psalm 150}}</pre>
producing (for three pages)
:{{LinkText|3|O magnum mysterium|Ave Maria|Psalm 150}}


{{LinkText|Psalm 131}}</pre>
<h4>Specifying ''italics'' or plain display explicitly</h4>
produce the text:
'''However,''' one may '''override''' this default behavior by setting the '''parameter''' <tt>st{{eq}}</tt> (for no italics) or <tt><nowiki>st=''</nowiki></tt> (for italics) as in the following examples:
:{{LinkText|Ave Maria}}
<pre>{{LinkText|Messiah|st=}}</pre>
producing (the preferred)
:{{LinkText|Messiah|st=}}
and
and
:{{LinkText|Psalm 131}}
<pre>{{LinkText|3|Messiah|Pie Jesu|Psalm 118|st=''}}</pre>
 
producing (not good)
'''Extended syntax examples:'''
:{{LinkText|3|Messiah|Pie Jesu|Psalm 118|st=''}}
<pre>{{LinkText|Ave Maria|{{sp}}- ''Virgo serena''}}
<pre>{{LinkText|3|Hallelujah|Psalm 118|st=}}</pre>
producing (not good)
:{{LinkText|3|Hallelujah||Pie Jesu|Psalm 118|st=}}
<pre>{{LinkText|3|Hallelujah|Pie Jesu|Psalm 118|st1=}}</pre>
producing (good)
:{{LinkText|3|Hallelujah|Pie Jesu|Psalm 118|st1=}}


{{LinkText|Psalm 114|:1-5.}}</pre>
<h5>Extended syntax examples</h5>
produces the text
To add more information at the end, when there is just one link, use the following scheme:
<pre>{{LinkText|Ave Maria|{{sp}}- ''Virgo serena''}}</pre>
produces
:{{LinkText|Ave Maria|{{sp}}- ''Virgo serena''}}
:{{LinkText|Ave Maria|{{sp}}- ''Virgo serena''}}
and
and
:{{LinkText|Psalm 114|:1-5.}}
<pre>{{LinkText|Lamentations of Jeremiah|{{sp}}'''1:1-5'''.|st=}}</pre>
(note the default italics have been overridden with "<tt><nowiki>st=</nowiki></tt>") produces
:{{LinkText|Lamentations of Jeremiah|{{sp}}'''1:1-5'''.|st=}}


'''More than one text (2 or 3):'''
'''More than one text (2 or 3):'''

Revision as of 15:11, 30 April 2009

Original text and translations may be found at [[{{{1}}}]].


Documentation

Default behavior

This template provides links for up to three text pages. Its default behavior is to italicize all links except those that begin with Psalm as in:

{{LinkText|Ave verum corpus}}

producing

Original text and translations may be found at Ave verum corpus.
{{LinkText|2|Psalm 131|Wachet auf, ruft uns die Stimme}}

producing (for two pages)

Original text and translations may be found at Psalm 131 and Wachet auf, ruft uns die Stimme.

and

{{LinkText|3|O magnum mysterium|Ave Maria|Psalm 150}}

producing (for three pages)

Original text and translations may be found at O magnum mysterium, Ave Maria, and Psalm 150.

Specifying italics or plain display explicitly

However, one may override this default behavior by setting the parameter st= (for no italics) or st='' (for italics) as in the following examples:

{{LinkText|Messiah|st=}}

producing (the preferred)

Original text and translations may be found at Messiah.

and

{{LinkText|3|Messiah|Pie Jesu|Psalm 118|st=''}}

producing (not good)

Original text and translations may be found at Messiah, Pie Jesu, and Psalm 118.
{{LinkText|3|Hallelujah|Psalm 118|st=}}

producing (not good)

Original text and translations may be found at Hallelujah, [[]], and Pie Jesu.
{{LinkText|3|Hallelujah|Pie Jesu|Psalm 118|st1=}}

producing (good)

Original text and translations may be found at Hallelujah, Pie Jesu, and Psalm 118.
Extended syntax examples

To add more information at the end, when there is just one link, use the following scheme:

{{LinkText|Ave Maria|{{sp}}- ''Virgo serena''}}

produces

Original text and translations may be found at Ave Maria - Virgo serena

and

{{LinkText|Lamentations of Jeremiah|{{sp}}'''1:1-5'''.|st=}}

(note the default italics have been overridden with "st=") produces

Original text and translations may be found at Lamentations of Jeremiah 1:1-5.

More than one text (2 or 3):

{{LinkText|3|O magnum mysterium|Ave Maria|Alma Redemptoris Mater}}

produces

Original text and translations may be found at O magnum mysterium, Ave Maria, and Alma Redemptoris Mater.
{{LinkText|2|Psalm 126|Psalm 95|add1=:1-9|add2=:3-6.}}

produces

Original text and translations may be found at Psalm 126:1-9 and Psalm 95:3-6.