Difference between revisions of "Template:Drep"

From blackwiki
Jump to navigation Jump to search
imported>Wbm1058
(link to AD 1 thru AD 9 for single-digit years, per discussion at Talk:1#Status of the discussion, and suggestion for limited implementation)
imported>JFG
(Switch to "AD 1" format instead of "1 AD")
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:{{{1}}} > 0 and {{{1}}} < 10 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|{{{1}}}&nbsp;<small>AD</small>]]|
+
ysa|yysa=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr:{{{1}}} > 0 and {{{1}}} < 10 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|<small>AD</small>&nbsp;{{{1}}}]]|
ya|yya=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr:{{{1}}} > 0 and {{{1}}} < 10 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|{{{1}}}&nbsp;AD]]|
+
ya|yya=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr:{{{1}}} > 0 and {{{1}}} < 10 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|AD&nbsp;{{{1}}}]]|
sa|nsa|ynsa={{{1}}}&nbsp;<small>AD</small>|
+
sa|nsa|ynsa=<small>AD</small>&nbsp;{{{1}}}|
a|na|yna={{{1}}}&nbsp;AD|
+
a|na|yna=AD&nbsp;{{{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:{{{1}}} > 0 and {{{1}}} < 10 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|{{{1}}}]]|
 
ys|yys|y|yy=[[{{#if:{{{3|}}}|{{{3}}}|{{#ifeq:{{#expr:{{{1}}}}}|{{{1}}}|{{#ifexpr:{{{1}}} > 0 and {{{1}}} < 10 | AD {{{1}}} | {{{1}}} }}|{{{1}}} }}}}|{{{1}}}]]|

Revision as of 09:49, 19 November 2016

{{{1}}}

Template documentation[view] [edit] [history] [purge]

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}} AD 1
  • {{drep|1|ysa}} AD 1
  • {{drep|1|yap}}
  • {{drep|1|ysap}}
  • {{drep|1|yab}} 1 BC
  • {{drep|1|ysab}} 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