Difference between revisions of "Template:Dr-make"

From blackwiki
Jump to navigation Jump to search
imported>JFG
(More spacing in code where feasible without changing output)
imported>JFG
(Use prefix notation "AD 1" for years 1-100)
Line 1: Line 1:
 
<includeonly>{{#switch:{{{2}}}
 
<includeonly>{{#switch:{{{2}}}
   |y={{#switch:{{#expr:{{{1}}}<-729}}{{#expr:{{{1}}}<1}}{{#expr:{{{1}}}<2070}}
+
   |y={{#switch:{{#expr:{{{1}}}<-729}}{{#expr:{{{1}}}<1}}{{#expr:{{{1}}}<101}}{{#expr:{{{1}}}<2070}}
     |111={{drep |{{#expr:1-{{{1}}}}}| {{{3|}}}b }}
+
     |1111={{drep |{{#expr:1-{{{1}}}}}| {{{3|}}}b }}
     |011={{drep |{{#expr:1-{{{1}}}}}| y{{{3|}}}b }}
+
     |0111={{drep |{{#expr:1-{{{1}}}}}| y{{{3|}}}b }}
     |001={{drep |{{{1}}}| y{{{3|}}} }}
+
     |0011={{drep |{{{1}}}| y{{{3|}}}{{#switch:{{{3}}}|a|ya|sa|ysa|na|nsa=p}} }}
     |000={{drep |{{{1}}}| {{{3|}}} }}
+
    |0001={{drep |{{{1}}}| y{{{3|}}} }}
 +
     |0000={{drep |{{{1}}}| {{{3|}}} }}
 
   }}
 
   }}
 
   |d={{#switch:{{{1}}}
 
   |d={{#switch:{{{1}}}

Revision as of 11:52, 19 November 2016

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

Usage

Produces a representation of a logically-numbered year/decade/century/millennium (first parameter). Second para is y/d/c/m. Representation style depends on the third parameter:

  • (parameter empty or absent): links to the year if it has an article (not a redirect)
  • y: always links
  • n: never links
  • t: produces simple text (no no-break spaces etc.), e.g. for use in category names
  • s: displays AD or BC in small capitals
  • a: adds AD if not BC
  • p: displays AD as prefix (only valid with a)
  • ys, ya, ysa, ns, na, nsa, sa: permitted combinations of above options
  • yap, ysap, nap, nsap, sap: combinations with AD prefix

Used by {{dr}}. Uses {{drep}}.

Examples