Template:R/ref: Difference between revisions
From Vigyanwiki
Template>Matthiaspaul (fixed wrapping) |
Template>Matthiaspaul (updated from sandbox now using the /superscript subtemplate for easier future maintence, thereby now also distinguishes between page/pages/at and quote-page/quote-pages for singular/plural) |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
### Debug facility: ### | ### Debug facility: ### | ||
-->{{#if:{{{debug|}}}|DEBUG: 1="{{{1|}}}", 2="{{{2|}}}", 3="{{{3|}}}", 4="{{{4|}}}", name="{{{name|}}}", group="{{{group|}}}", page="{{{page|}}}", pages="{{{pages|}}}", location="{{{location|}}}", quote="{{{quote|}}}", | -->{{#if:{{{debug|}}}|DEBUG: 1="{{{1|}}}", 2="{{{2|}}}", (3="{{{3|}}}"), (4="{{{4|}}}"), (name="{{{name|}}}"), (group="{{{group|}}})", direction="{{{direction|}}}", page="{{{page|}}}", pages="{{{pages|}}}", location="{{{location|}}}", quote-page="{{{quote-page|}}}", quote-pages="{{{quote-pages|}}}", quote="{{{quote|}}}", quote-language="{{{quote-language|}}}", trans-quote="{{{trans-quote|}}}", quote-cite="{{{quote-cite|}}}", reference="{{{reference|}}}", annotation="{{{annotation|}}}", leadin="{{{leadin|}}}", postscript="{{{postscript|}}}", section="{{{section|}}}", needed-reason="{{{needed-reason|}}}", needed-date="{{{needed-date|}}}", wrap="{{{wrap|}}}", no-pp="{{{no-pp|}}}", style="{{{style|}}}", content-id="{{{content-id|}}}", link-id="{{{link-id|}}}", debug="{{{debug|}}}". Potential context-section-name:"{{anchorencode:cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}}}".}}<!-- | ||
### Opening "support context" span: ### | ### Opening "support context" span: ### | ||
-->{{#if:{{{section|}}}|{{#if:{{#lst:{{FULLPAGENAME}}|{{anchorencode:{{#switch:{{{section|}}}||y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}|{{{section|}}}}}}}}}|<templatestyles src="Template:Tooltip/styles.css"/><span class="rt-commentedText tooltip tooltip-dotted" title="Context: "{{#invoke:String|replace|{{#invoke:Plain text|main|1={{#lst:{{FULLPAGENAME}}|{{anchorencode:{{#switch:{{{section|}}}||y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}|{{{section|}}}}}}}}}|encode=false}}|"|"}}"">}}}}<!-- | -->{{#if:{{{section|}}}|{{#if:{{#lst:{{FULLPAGENAME}}|{{anchorencode:{{#switch:{{{section|}}}||y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}|{{{section|}}}}}}}}}|<templatestyles src="Template:Tooltip/styles.css"/><span class="rt-commentedText tooltip tooltip-dotted" title="Context: "{{#invoke:String|replace|{{#invoke:Plain text|main|1={{#lst:{{FULLPAGENAME}}|{{anchorencode:{{#switch:{{{section|}}}||y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}|{{{section|}}}}}}}}}|encode=false}}|"|"}}"">}}}}<!-- | ||
### First call to create reference link: ### | ### First call to create reference link: ### | ||
-->{{#if:{{{link-id|}}}|<span id="{{anchorencode:{{{link-id|}}}}}" class="citation<!-- wikicite cite-r -->">}}{{#tag:ref|{{#if:{{{annotation|}}}||{{#if:{{{content-id|}}}|<span<!-- or <cite...> --> id="{{anchorencode:{{{content-id|}}}}}" class="citation<!-- wikicite cite-r -->">}}{{{reference|}}}{{#if:{{{content-id|}}}|</span><!-- or </cite> -->}}{{{postscript|}}}}}|name={{{1|}}}|group={{{2|}}}}}{{#if:{{{link-id|}}}|</span>}}<!-- | -->{{#if:{{{link-id|}}}|<span id="{{anchorencode:{{{link-id|}}}}}" class="citation<!-- wikicite cite-r -->">}}{{#tag:ref|{{#if:{{{annotation|}}}||{{#if:{{{content-id|}}}|<span<!-- or <cite...> --> id="{{anchorencode:{{{content-id|}}}}}" class="citation<!-- wikicite cite-r -->">}}{{{reference|}}}{{#if:{{{content-id|}}}|</span><!-- or </cite> -->}}{{{postscript|}}}}}|name={{{1|}}}|group={{{2|}}}<!-- |dir={{{direction|}}} -->}}{{#if:{{{link-id|}}}|</span>}}<!-- | ||
### Optional second call to append data to reference: ### | ### Optional second call to append data to reference: ### | ||
-->{{#if:{{{annotation|}}}|{{#tag:ref|{{#switch:{{{annotation|}}}|p|page|pages={{#if:{{{pages|}}}{{{page|}}}{{{location|}}}|‌{{#if:{{{content-id|}}}|<span id="{{anchorencode:{{{content-id|}}}}}">}}{{{leadin|}}}{{{pages|}}}{{{page|}}}{{{location|}}}{{#if:{{{content-id|}}}|</span>}}}}|quote|q=‌{{#switch:{{{quote-page|}}}|=|p|page|pages={{#if:{{{pages|}}}{{{page|}}}{{{location|}}}|{{{leadin|}}}{{{pages|}}}{{{page|}}}{{{location|}}}: }}|{{{leadin|}}}{{{quote-page|}}}: }}<q {{#if:{{{content-id|}}}|id="{{anchorencode:{{{content-id|}}}}}"}} {{#if:{{{quote-cite|}}}|cite="#{{anchorencode:{{{quote-cite|}}}}}"}} {{#if:{{{quote-language|}}}|lang="{{{quote-language|}}}"}}><bdi | -->{{#if:{{{annotation|}}}|{{#tag:ref|{{#switch:{{{annotation|}}}|p|pp|page|pages={{#if:{{{pages|}}}{{{page|}}}{{{location|}}}|‌{{#if:{{{content-id|}}}|<span id="{{anchorencode:{{{content-id|}}}}}">}}{{{leadin|}}}{{{pages|}}}{{{page|}}}{{{location|}}}{{#if:{{{content-id|}}}|</span>}}}}|quote|q=‌{{#switch:{{{quote-page|}}}|=|p|pp|page|pages={{#if:{{{pages|}}}{{{page|}}}{{{location|}}}|{{{leadin|}}}{{{pages|}}}{{{page|}}}{{{location|}}}: }}|{{{leadin|}}}{{{quote-page|}}}: }}<q {{#if:{{{content-id|}}}|id="{{anchorencode:{{{content-id|}}}}}"}} {{#if:{{{quote-cite|}}}|cite="#{{anchorencode:{{{quote-cite|}}}}}"}} {{#if:{{{quote-language|}}}|lang="{{{quote-language|}}}"}}><bdi>{{trim quotes|s={{{quote|}}}}}</bdi></q>{{#if:{{{trans-quote|}}}| [<bdi>{{trim quotes|s={{{trans-quote|}}}}}</bdi>]}}|{{#if:{{{content-id|}}}|<span<!-- or <cite...> --> id="{{anchorencode:{{{content-id|}}}}}" class="citation<!-- wikicite cite-r -->">}}{{{leadin|}}}{{{annotation|}}}{{#if:{{{content-id|}}}|</span><!-- or </cite> -->}}}}{{{postscript|}}}|follow={{{1|}}}|group={{{2|}}}<!-- |dir={{{direction|}}} -->}}}}<!-- | ||
### Superscript pages and tooltip for help, pages, quotes: ### | ### Superscript pages and tooltip for help, pages, quotes: ### | ||
-->{{# | -->{{r/superscript | ||
|prefix={{#switch:{{{style|}}}|AMA|Ama|ama=(|:}} | |||
|suffix={{#switch:{{{style|}}}|AMA|Ama|ama=)}} | |||
|pp={{#switch:{{{style|}}}|AMA|Ama|ama={{#if:{{{no-pp|}}}||{{#if:{{{page|}}}|p|{{#if:{{{pages|}}}|pp}}}}}}}}<!-- pp is only used in superscript label, therefore it does not contain any qp params --> | |||
|leadin={{#switch:{{{quote-page|{{{quote-pages|}}}}}}|pp|pages|p|page={{#if:{{{page|}}}|Page|{{#if:{{{pages|}}}|Pages|{{#if:{{{location|}}}|Location|Page / location}}}}}}|{{#if:{{{quote-page|}}}|Page|{{#if:{{{quote-pages|}}}|Pages|{{#if:{{{location|}}}|Location|{{#if:{{{page|}}}|Page|{{#if:{{{pages|}}}|Pages|{{#if:{{{location|}}}|Location|Page / location}}}}}}}}}}}}}}<!-- leadin is only used in tooltip --> | |||
|where={{#if:{{{page|{{{location|}}}}}}|{{{page|{{{location|}}}}}}|{{#invoke:String2|hyphen2dash|{{{pages}}}}}}}<!-- where must not include qp params --> | |||
|quote-where={{#switch:{{{quote-page|{{{quote-pages|}}}}}}|pp|pages|p|page={{#if:{{{page|{{{location|}}}}}}|{{{page|{{{location|}}}}}}|{{#invoke:String2|hyphen2dash|{{{pages|}}}}}}}|{{#if:{{{quote-page|}}}|{{{quote-page|}}}|{{#invoke:String2|hyphen2dash|{{{quote-pages|}}}}}}}}}<!-- quote-where must not contain normal in-source-location params --> | |||
|quote={{{quote|}}} | |||
|language={{{quote-language|}}} | |||
|translation={{{trans-quote|}}} | |||
|wrap={{{wrap|}}} | |||
}}<!-- | |||
### Closing "support context" span: ### | ### Closing "support context" span: ### | ||
-->{{#if:{{{section|}}}|{{#if:{{#lst:{{FULLPAGENAME}}|{{anchorencode:{{#switch:{{{section|}}}||y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}|{{{section|}}}}}}}}}|</span>}}}}<!-- | -->{{#if:{{{section|}}}|{{#if:{{#lst:{{FULLPAGENAME}}|{{anchorencode:{{#switch:{{{section|}}}||y|yes=cite_sect-{{trim quotes|s={{{1|}}}}}-{{trim quotes|s={{{2|}}}}}-{{trim quotes|s={{{pages|}}}{{{page|}}}{{{location|}}}}}|{{{section|}}}}}}}}}|</span>}}}}<!-- |
Revision as of 00:22, 11 September 2021
Template documentation
[create]