Template:R/ref: Difference between revisions
From Vigyanwiki
Template>Matthiaspaul (flattened eval of pages/page/location) |
Template>Matthiaspaul (removed support for no longer needed unnamed parameters 3 and 4, added debug) |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
### Debug facility: ### | |||
-->{{#if:{{{debug|}}}|1="{{{1|}}}", 2="{{{2|}}}", 3="{{{3|}}}", 4="{{{4|}}}", name="{{{name|}}}", group="{{{group|}}}", page="{{{page|}}}", pages="{{{pages|}}}", location="{{{location|}}}", quote="{{{quote|}}}", quote-page="{{{quote-page|}}}", reference="{{{reference|}}}", annotation="{{{annotation|}}}", leadin="{{{leadin|}}}", postscript="{{{postscript|}}}", section="{{{section|}}}", needed-reason="{{{needed-reason|}}}", needed-date="{{{needed-date|}}}", wrap="{{{wrap|}}}", debug="{{{debug|}}}".}}<!-- | |||
### Opening "support context" span: ### | ### Opening "support context" span: ### | ||
-->{{#if:{{{section|}}}|{{#if:{{#lst:{{FULLPAGENAME}}|{{anchorencode:<!--{{#switch:{{{section}}}|{{{section}}}|y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location | -->{{#if:{{{section|}}}|{{#if:{{#lst:{{FULLPAGENAME}}|{{anchorencode:<!--{{#switch:{{{section}}}|{{{section}}}|y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}|{{{section|}}}}}-->{{{section|cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}}}}<!---->}}}}|<templatestyles src="Template:Tooltip/styles.css"/><span class="rt-commentedText tooltip tooltip-dotted" title="Context: "{{#tag:nowiki|{{#invoke:String|replace|{{#lst:{{FULLPAGENAME}}|{{anchorencode:<!--{{#switch:{{{section}}}|{{{section}}}|y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}|{{{section|}}}}}-->{{{section|cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}}}}<!---->}}}}|"|"}}}}"">}}}}<!-- | ||
### First call to | ### First call to create reference link: ### | ||
-->{{#tag:ref|{{#if:{{{annotation|}}}||{{{reference|}}}{{{postscript|}}}}}|name={{{1|}}}|group={{{2|}}}}}<!-- | -->{{#tag:ref|{{#if:{{{annotation|}}}||{{{reference|}}}{{{postscript|}}}}}|name={{{1|}}}|group={{{2|}}}}}<!-- | ||
### Optional second call to append data: ### | ### Optional second call to append data to reference: ### | ||
-->{{#if:{{{annotation|}}}|{{#tag:ref|{{#switch:{{{annotation|}}}|p|page|pages={{#if:{{{pages|}}}{{{page|}}}{{{location | -->{{#if:{{{annotation|}}}|{{#tag:ref|{{#switch:{{{annotation|}}}|p|page|pages={{#if:{{{pages|}}}{{{page|}}}{{{location|}}}|‌{{{leadin|}}}{{{pages|}}}{{{page|}}}{{{location|}}}}}|quote|q=‌{{#switch:{{{quote-page}}}|{{{quote-page}}}=|p|page|pages={{#if:{{{pages|}}}{{{page|}}}{{{location|}}}|{{{leadin|}}}{{{pages|}}}{{{page|}}}{{{location|}}}: }}|{{{leadin|}}}{{{quote-page|}}}: }}<q<!-- cite="#..." -->>{{#tag:nowiki|{{#invoke:String|replace|{{trim quotes|s={{{quote|}}}}}|"|"}}}}</q>|{{{leadin|}}}{{{annotation|}}}}}{{{postscript|}}}|follow={{{1|}}}|group={{{2|}}}}}}}<!-- | ||
### Superscript pages and tooltip for help, pages, quotes: ### | ### Superscript pages and tooltip for help, pages, quotes: ### | ||
-->{{#if:{{{pages|}}}{{{page|}}}{{{location | -->{{#if:{{{pages|}}}{{{page|}}}{{{location|}}}|<sup class="reference {{#switch:{{{wrap|}}}|f|forced=|nowrap}}"><nowiki>:</nowiki><span {{#if:{{{quote|}}}|style="border-bottom: 1px dashed;" title="Quotation{{#if:{{{quote-page|}}}| from page / location {{#switch:{{{quote-page|}}}|p|page|pages={{{pages|}}}{{{page|}}}{{{location|}}}|{{{quote-page|}}}}}}}: "{{#tag:nowiki|{{#invoke:String|replace|{{trim quotes|s={{{quote|}}}}}|"|"}}}}""|title="Page / location: {{#tag:nowiki|{{#invoke:String|replace|{{{pages}}}|{{{page|}}}{{{location|}}}|"|"}}}}"}}><!-- {{#invoke:String2|hyphen2dash|1=-->{{{pages|}}}{{{page|}}}{{{location|}}}<!--}}--></span></sup>}}<!-- | ||
### Closing "support context" span: | ### Closing "support context" span: | ||
-->{{#if:{{{section|}}}|{{#if:{{#lst:{{FULLPAGENAME}}|{{anchorencode:<!--{{#switch:{{{section}}}|{{{section}}}|y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location | -->{{#if:{{{section|}}}|{{#if:{{#lst:{{FULLPAGENAME}}|{{anchorencode:<!--{{#switch:{{{section}}}|{{{section}}}|y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}|{{{section|}}}}}-->{{{section|cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}}}}<!---->}}}}|</span>}}}}<!-- | ||
### Page needed functionality: ### | ### Page needed functionality: ### | ||
-->{{#if:{{{needed-reason|}}}|{{page needed|date={{{needed-date|}}}|reason={{#switch:{{{needed-reason|}}}|y|yes=No reason given|{{{needed-reason|}}}}}}}}}<!-- | -->{{#if:{{{needed-reason|}}}|{{page needed|date={{{needed-date|}}}|reason={{#switch:{{{needed-reason|}}}|y|yes=No reason given|{{{needed-reason|}}}}}}}}}<!-- |
Revision as of 05:05, 2 September 2021
Template documentation
[create]