Template:R/ref: Difference between revisions
From Vigyanwiki
Template>Matthiaspaul (reactivated after fixing bug) |
Template>Matthiaspaul (copied from sandbox, activated support for optional dir=ltr/rtl per Cite extension doc) |
||
Line 4: | Line 4: | ||
### 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 (variants identical except for dir): ### | ||
-->{{#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 id="{{anchorencode:{{{link-id|}}}}}" class="citation<!-- wikicite cite-r -->">}}{{#if:{{{direction|}}}|{{#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|}}}}}|{{#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>}}<!-- | ||
### Optional second call to append data to reference: ### | ### Optional second call to append data to reference (variants identical except for dir): ### | ||
-->{{#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|}}}<!-- | | -->{{#if:{{{annotation|}}}|{{#if:{{{direction|}}}|{{#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|}}}}}|{{#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|}}}}}}}}}<!-- | ||
### Superscript pages and tooltip for help, pages, quotes: ### | ### Superscript pages and tooltip for help, pages, quotes: ### | ||
-->{{r/superscript | -->{{r/superscript |
Revision as of 02:46, 11 September 2021
Template documentation
[create]