Difference between revisions of "Template:Drep/sandbox"
Jump to navigation
Jump to search
imported>Xaosflux (suggested change from talk) |
imported>Wugapodes (all n: 0<n<1001 are linked with AD prefix) |
||
| Line 7: | Line 7: | ||
tb|ytb|tab|ytab={{#if:{{{3|}}}|{{{3}}}|{{{1}}}}} BC| | tb|ytb|tab|ytab={{#if:{{{3|}}}|{{{3}}}|{{{1}}}}} BC| | ||
tbd|ytbd|tabd|ytabd={{#if:{{{3|}}}|{{{3}}}|{{{1}}}}} BC (decade)| | tbd|ytbd|tabd|ytabd={{#if:{{{3|}}}|{{{3}}}|{{{1}}}}} BC (decade)| | ||
| − | ysa|yysa=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr: | + | ysa|yysa=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr:{{{1}}} > 0 and {{{1}}} <= 1000 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|{{{1}}} <small>AD</small>]]| |
| − | ya|yya=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr: | + | ya|yya=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr:{{{1}}} > 0 and {{{1}}} <= 1000 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|{{{1}}} AD]]| |
| − | ysap|yysap=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr: | + | ysap|yysap=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr:{{{1}}} > 0 and {{{1}}} <= 1000 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|<small>AD</small> {{{1}}}]]| |
| − | yap|yyap=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr: | + | yap|yyap=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr:{{{1}}} > 0 and {{{1}}} <= 1000 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|AD {{{1}}}]]| |
sa|nsa|ynsa={{{1}}} <small>AD</small>| | sa|nsa|ynsa={{{1}}} <small>AD</small>| | ||
a|na|yna={{{1}}} AD| | a|na|yna={{{1}}} AD| | ||
| Line 16: | Line 16: | ||
ap|nap|ynap=AD {{{1}}}| | ap|nap|ynap=AD {{{1}}}| | ||
ta|yta|t|yt={{#if:{{{3|}}}|{{{3}}}|{{{1}}}}}| | ta|yta|t|yt={{#if:{{{3|}}}|{{{3}}}|{{{1}}}}}| | ||
| − | ys|yys|y|yy=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr: | + | ys|yys|y|yy=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr:{{{1}}} > 0 and {{{1}}} <= 1000 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|{{{1}}}]]| |
s|ns|yns||n|yn={{{1}}}}}<noinclude> | s|ns|yns||n|yn={{{1}}}}}<noinclude> | ||
{{documentation}} | {{documentation}} | ||
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> | <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> | ||
</noinclude> | </noinclude> | ||
Latest revision as of 00:54, 8 August 2019
{{{1}}}
| 50px | This is the template sandbox page for Template:Drep (diff). See also the companion subpage for test cases. |
Usage
Produces a representation of a date. First parameter is the display text; second is the style; third is the link text (defaults to the display text). Style parameters:
- (parameter empty or absent): no link
- y/yy: link
- n: no link even after y
- t: no link even after y, but return the link text
- s: displays AD or BC in small capitals
- a: adds AD if no b
- p: places AD as prefix (only valid with a)
- b: adds BC
- d: adds (decade) to link only, and only if immediately following b
The above options can be combined, in that order (but t not with n or s).
This template is used by {{dr-make}}.
Examples
- {{drep|1}} 1
- {{drep|1|y}} 1
- {{drep|1|y|AD 1}} 1
- {{drep|1|y|1 CE}} 1
- {{drep|1|yy}} 1
- {{drep|1|yn}} 1
- {{drep|1|yt}} 1
- {{drep|1|ya}} 1 AD
- {{drep|1|ysa}} 1 AD
- {{drep|1|yap}} AD 1
- {{drep|1|ysap}} AD 1
- {{drep|1|yab}} 1 BC
- {{drep|1|ysab}} 1 BC
- {{drep|10s|y}} 10s
- {{drep|100s|ysabd}} 100s BC
- {{drep|911|y|911 (year)}} 911
- {{drep|1984|y}} 1984
- {{drep|2001|y}} 2001
- {{drep|2084|y}} 2084
- {{drep|3035|y}} 3035
| The above documentation is transcluded from Template:Drep/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |