Template:Reign/doc

Usage
This template generates an abbreviation for reign (or the Latin rexit): (r. undefined – undefined)

Typical example: produces:
 * Emperor Augustus of Rome ((r. 27 BCE – 14 CE))

Default output
In all such cases, the following is true:
 * With no parameters and two values, the display is:
 * with simple values (en dash is not spaced):  → (r. 1962 – present)
 * with one or more complex values (containing whitespace; en dash is spaced):  → (r. c. 23 BCE – 5 CE)
 * with only a start date:  → (r. 1962 – undefined) (This usage is deprecated; use "present" to indicate an ongoing time span, per MOS:DATERANGE – leaving it blank looks like an error.)
 * 1) The "(r. undefined – undefined)" is marked up with  to provide a mouse-over tooltip that explains that the abbreviation means "reign"
 * 2) The space after the "(r. undefined – undefined)" and any between dates and dash are non-breaking spaces, while the values of the date parameters are also non-breaking, in case they contain any spaces. I.e., no line-wrapping will occur anywhere within "(r. c. 23 BCE – 5 CE)".

Additional notes:
 * If a blank first date is given, a "?" will be generated for it:  produces "(r. undefined – 732)", and    produces "(r. undefined – c. 732)"
 * Legacy use (deprecated): If the template is used with no values, it simply outputs the marked-up "(r. undefined – undefined)" Given something like , a line wrap may occur between the "(r. undefined – undefined)" and the first date unless a non-breaking space is used.
 * This template does not do any date error checking like that performed by the citation templates. If you input "Ferberary 38, 200017", this will be the output.

Parameters

 * 1 or first unnamed parameter – Start date, e.g. "1935", "c. 1205", "37 BCE", "August 1434", "January 1, 2017".
 * 2 or second unnamed parameter – End date, e.g. "present", or any of the sorts of dates used in 1
 * 3 or third unnamed parameter – Start date of second range.
 * 4 or fourth unnamed parameter - End date of second range.
 * The template only supports two date ranges (plus individual dates, see below). It can be extended fairly easily to support more if necessary.
 * The 3 and 4 parameters do not work in the absence of 2.
 * single – A single date (typically a year) for a short reign, where no range is needed. Using  avoids the redundant "(r. 1872 – 1872)" and emits "(r. undefined – undefined)".  (This is actually an alias of the post-date parameter.)
 * show a.k.a. link a.k.a lk – Controls formatting of the "r.":
 * none – Produces no tooltip or link: "(r. undefined – undefined)"; intended for use at second and later occurrences. This can also be done with other negative values such as no, n , off , false , 0.
 * link – Replaces the markup with a link to the Reign article: "(r. undefined – undefined)"; .  This can also be done with positive values such as yes, y , on , true , 1
 * abbr – Deprecated; shows "r." with markup, with is already the default output; this parameter does not need to be used.
 * pre-date – A single date to appear before the date range (a comma-space will be inserted between them). This parameter can be "cheated" to show multiple dates in series, e.g. 1645, 1652
 * post-date – Same as pre-date, but appears after the date range. (single is an alias of this parameter, which is coded to not emit a comma-space if used as the only date.)
 * Use these two parameters to specify independent years rather than a range, for two short, non-contiguous terms in office:  → (r. undefined – undefined)
 * : These two parameters are included within the non-wrapping span; if you misuse them to insert long-winded annotations instead of dates this will cause display problems if you do not turn on yes.
 * mid-date – A single date to appear between the 12 and 34 date ranges. As with the former two parameters, it can be "cheated" to show multiple dates in series.
 * era – Gives the "era" at the end. Used (typically with BCE or BC, and without links after first occurrence) when the era must be specified and both/all dates are simple and . E.g.,   produces "(r. 89 – 67)" (while   produces the incorrectly spaced "(r. 89 – 67 BCE)").
 * When either or both dates contain whitespace, this parameter is optional and harmless (and correctly produces the spaced en dash);  yields "(r. 89 – c. 67)" which is identical to the output of  : "(r. 89 – c. 67 BCE)".
 * This parameter can also be used for a year, when followed by various months as the dates; it is not really limited to "eras" in the vast sense.
 * There is no parameter for front-loading both dates with "c.", "AD", or another value. "c." applies to a specific date: "c. 89 – 67 BCE" means "from approximately 89 BCE to definitely 67 BCE". To express that both dates are approximate, use  or.
 * yes – Permits the content to line-wrap at key points (right after a comma, i.e. between two date ranges, between pre-date and 1, between the late range date and post-date). Any value supplied to wrap will turn this option on.  Does  permit wrapping within a date range, or between the "(r. undefined – undefined)" (or replacement wording provided by show options) and the first date, or between the last date and era.

For use in tables and such
Some of these could also be used, for clarity, in lead sections of articles that are confusingly thick with abbreviations and other markup.
 * show a.k.a. link a.k.a. lk – Can be used to replace the "r.":
 * word – Uses the word "reigned" instead of "r.": (r. undefined – undefined)
 * colon – Uses the word "reign", followed by a colon, instead of "r.": (r. undefined – undefined)
 * lword – Same as word, but with a link to Reign article: (r. undefined – undefined)
 * lcolon – Same as colon, but with a link to Reign article: (r. undefined – undefined)
 * blank – Shows nothing but the date values and dash, for use in tables and infoboxes with a header that already says this data indicates the reign.
 * yes – Capitalizes the r./reigned/reign text, for use in lists and such.   Any value supplied to cap will turn this option on.  Examples:
 * y alone – (r. undefined – undefined)
 * ynone → (r. undefined – undefined)
 * ylink → (r. undefined – undefined)
 * yword →(r. undefined – undefined)
 * ycolon → (r. undefined – undefined)
 * ylword → (r. undefined – undefined)
 * ylcolon → (r. undefined – undefined)
 * sortable – Only for use in sortable tables (see below for pros and cons of using thing). Uses as a sort key the value of sort_date – or, if that was not specified, the value of one of the following, in descending order of precedence: single, pre-date, 1, 2, post-date; at least one such date must be specified for this to work.
 * sort_date – Provide a custom date to sort by, e.g. ISO yyyy-mm-dd format, or "-43" for "43 BCE", or "983" for "c. 983". This parameter may also be spelled sortdate or sort-date.

For use in non-royalty contexts

 * label – Free-form parameter for replacing "(r. undefined – undefined)" with some other word or phrase. Overrides any show or cap values. Examples:
 * in office → (r. undefined – undefined)
 * World Champion: → (r. undefined – undefined)
 * Doing  is effectively synonymous with doing something like , but the former has the virtue of being more concise and grouping the label into the template, in case it needs to be moved.
 * If yes, then content may wrap after label, since its content may be arbitrarily long.
 * The aforementioned blank can also be used to repurpose this template for all sorts of date and even non-date numeric ranges.

Redirects
also can be called with the redirects: