Spring til indhold

Skabelon:Regerede

Fra Wikipedia, den frie encyklopædi
(Omdirigeret fra Skabelon:R.)

r

Documentation icon Skabelondokumentation[vis] [redigér] [historik] [opfrisk]

This template generates an abbreviation for regerede (or the Latin rexit): r

Typical example:

  • Emperor [[Augustus]] of [[Romerriget|Rome]] ({{regerede|27 f.Kr.|14 e.Kr.}})

produces:

Default output

[rediger kildetekst]
  • With no parameters and two values, the display is:
    • with simple values (en dash is not spaced): {{regerede|1962|present}}r. 1962–present
    • with one or more complex values (containing whitespace; en dash is spaced): {{regerede|ca. 23 f.Kr.|5 e.Kr.}}r. c. 23 f.Kr. – 5 e.Kr.
    • with only a start date: {{regerede|1962}}r. 1962– 

In all such cases, the following is true:

  1. The "r" is marked up with <abbr>...</abbr> to provide a mouse-over tooltip that explains that the abbreviation means "regerede"
  2. The space after the "r" 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 f.Kr. – 5 e.Kr".

Additional notes:

  • If a blank first date is given, a "?" will be generated for it: {{regerede||732}} produces "r. ?–732", and {{regerede||c. 732}} produces "r. ? – c. 732"
  • Legacy use (deprecated): If the template is used with no values, it simply outputs the marked-up "r" Given something like {{regerede}} 1962–present, a line wrap may occur between the "r" 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

[rediger kildetekst]
  • |1= or first unnamed parameter – Start date, e.g. "1935", "ca.. 1205", "37 f.Kr.", "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 regerede, where no range is needed. Using {{regerede|single=1872}} avoids the redundant "r. 1872–1872" and emits "r. 1872". (This is actually an alias of the |post-date= parameter.)
  • |show= a.k.a. |link= a.k.a |lk= – Controls formatting of the "r.":
    • |show=none – Produces no tooltip or link: "r"; intended for use at second and later occurrences. This can also be done with other negative values such as no, n, off, false, 0.
    • |show=abbrDeprecated; shows "r." with <abbr> 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. |pre-date=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: {{regerede|pre-date=1732|post-date=1735}}r. 1732, 1735
    • Warning: 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 |wrap=yes.
  • |mid-date= – A single date to appear between the |1=|2= and |3=|4= 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 f.Kr. or BC) when the era must be specified and both/all dates are simple and within the same era. E.g., {{regerede|89|67|era=[[Common Era|f.Kr.]]}} produces "r. 89–67 f.Kr." (while {{regerede|89|67 f.Kr.}} produces the incorrectly spaced "r. 89 – 67 f.Kr.").
    • When either or both dates contain whitespace, this parameter is optional and harmless (and correctly produces the spaced en dash); {{regerede|89|c. 67|era=f.Kr.}} yields "r. 89 – c. 67 f.Kr." which is identical to the output of {{regerede|89|c. 67 f.Kr.}}: "r. 89 – c. 67 f.Kr.".
    • 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. This is because:
    • "c." applies to a specific date: "c. 89 – 67 f.Kr." means "from approximately 89 f.Kr. to definitely 67 f.Kr.". To express that both dates are approximate, use {{regerede|c. 89|c. 67 f.Kr.}} or {{regerede|c. 89|c. 67|f.Kr.}}.
    • "AD", when needed (usually only for perhaps confusingly short dates like "9" and "32") is given after the date on Wikipedia, as in most other academic publications; the AD 32 style is not used here.
  • |wrap=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 not permit wrapping within a date range, or between the "r" (or replacement wording provided by |show= options) and the first date, or between the last date and |era=.

For use in tables and such

[rediger kildetekst]

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.":
    • |show=word – Uses the word "regerede" instead of "r.": regerede 
    • |show=colon – Uses the word "regerede", followed by a colon, instead of "r.": regerede: 
    • |show=lword – Same as |show=word, but with a link to regerede article: r
    • |show=lcolon – Same as |show=colon, but with a link to regerede article: r
    • |show=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 regerede.
  • |cap=yes – Capitalizes the r./regeredeed/regerede text, for use in lists and such. This should never be used in mid-sentence in regular text. Any value supplied to |cap= will turn this option on. Examples:
    • |cap=y alone – R
    • |cap=y|show=noneR. 
    • |cap=y|show=linkR
    • |cap=y|show=wordRegerede 
    • |cap=y|show=colonRegerede: 
    • |cap=y|show=lwordR
    • |cap=y|show=lcolonR
  • |sortable= – Only for use in sortable tables {{crossref|(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 f.Kr.", or "983" for "c. 983". This parameter may also be spelled |sortdate= or |sort-date=.

For use in non-royalty contexts

[rediger kildetekst]
  • |label= – Free-form parameter for replacing "r" with some other word or phrase. Overrides any |show= or |cap= values. Examples:
    • |label=in officein office 
    • |label=[[World Snooker Championship|World Champion]]:World Champion
    • Doing {{regerede|1653|1658|label=ruled}} is effectively synonymous with doing something like ruled {{regerede|1653|1658|show=blank}}, 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 |wrap=yes, then content may wrap after |label=, since its content may be arbitrarily long.
  • The aforementioned |show=blank can also be used to repurpose this template for all sorts of date and even non-date numeric ranges.

Notes on table sorting

[rediger kildetekst]

Skabelon:Circa/doc/sortable

Code Output Works?
{{Regerede}} 1207–1272 r 1207–1272 Ja
{{Regerede|1207|1272}} r. 1207–1272 Ja
{{Regerede |1 October 1207 |1272}} r. 1 October 1207 – 1272 Ja
{{Regerede |1 October 1207 |16 November 1272}} r. 1 October 120 – 16 November 1272 Ja
{{Regerede |1207 |16 November 1272}} r. 1207 – 16 November 1272 Ja
{{Regerede |c. 1207 |1272}} r. c. 1207 – 1272 Ja
{{Regerede |1207 |present}} r. 1207–present Ja
{{Regerede |July 27, 2016 |present}} r. July 27, 2016 – present Ja
{{Regerede |1207 |1272}} r. 1207–1272 Ja
{{Regerede |1207| 1272}} r. 1207–1272 Ja
{{Regerede | 1207 | 1272 }} r. 1207–1272 Ja
{{Regerede |c.1207 |1272}} r. c.1207–1272 Nej[1]
{{Regerede |1962|present |show=word}} regerede 1962–present Ja
{{Regerede |1962|present |show=word |cap=y}} Regerede 1962–present Ja
{{Regerede |1962|present |show=colon}} regerede: 1962–present Ja
{{Regerede |1962|present |show=colon |cap=y}} Regerede: 1962–present Ja
{{Regerede |1962|present |show=lword}} r. 1962–present Ja
{{Regerede |1962|present |show=lword |cap=y}} R. 1962–present Ja
{{Regerede |1962|present |show=lcolon}} r. 1962–present Ja
{{Regerede |1962|present |show=lcolon |cap=y}} R. 1962–present Ja
{{Regerede |1962|present |show=blank}} 1962–present Ja
{{Regerede |1985}} r. 1985–  Ja
{{Regerede ||c. 320 BC}} r. ? – c. 320 BC Ja
{{Regerede ||940}} r. ?–940 Ja
{{Regerede}} r Ja
{{Regerede |89|67 f.Kr.}} r. 89 – 67 f.Kr. Nej[2]
{{Regerede |89|67 |era=f.Kr.}} r. 89–67 f.Kr. Ja
{{Regerede |c. 89|67 |era=f.Kr.}} r. c. 89 – 67 f.Kr. Ja[3]
{{Regerede |label=ruled|1967|1969}} ruled 1967–1969 Ja
{{Regerede |label=[[World Snooker Championship|World Champion]]:|1967|1969}} World Champion: 1967–1969 Ja
{{Regerede |1267 |1272 |post-date=1275}} r. 1267–1272, 1275 Ja
{{Regerede |c. 1267 |1272 |post-date=1275}} r. c. 1267 – 1272, 1275 Ja
{{Regerede |pre-date=1265 |1267 |1272 }} r. 1265, 1267–1272 Ja
{{Regerede |pre-date=1265 |c. 1267 |1272 |post-date=1275}} r. 1265, c. 1267 – 1272, 1275 Ja
{{Regerede |pre-date=c. 54 |43 |post-date=37 |era=f.Kr.}} r. c. 54, 43– , 37 f.Kr. Ja
{{Regerede |pre-date=1265 |post-date=1277}} r. 1265, 1277 Ja
{{Regerede |single=43 e.Kr.}} r. 43 e.Kr. Ja
{{Regerede|512|514|520|522}} r. 512–514, 520–522 Ja
{{Regerede |1 May 1995|30 April 1996 |1 May 1999|30 April 2000 |wrap=y}} r. 1 May 1995 – 30 April 1996, ​1 May 1999 – 30 April 2000 Ja
{{Regerede |pre-date=January |1=March|2=May |3=August|4=September |post-date=November |era=2017 |wrap=y}} r. January, ​March–May, ​August–September, ​November 2017 Ja
{{Regerede|512|514|mid-date=517|520|522}} r. 512–514, 517, 520–522 Ja
{{Regerede |1= 512 |2= 514 | mid-date=517 |3= 520 |4= c. 522 }} r. 512–514, 517, 520 – c. 522 Ja
  1. ^ c.1207 is invalid style (should be c. 1207), and it consequently is wrongly parsed as a simple date, so the en dash in turn is incorrectly unspaced.
  2. ^ 89|69 f.Kr. produces a spaced en dash, incorrect in this case because the date range is simple and "f.Kr." applies to both; this should instead be done with 89|69|era=f.Kr..
  3. ^ "r. c. 89 – 67 f.Kr." is correct because ca. (cirka) applies only to a single date. Using ca. 89–67 is invalid, as ambiguous. To show two uncertain dates: "r. c. 89 – c. 67 f.Kr.".

{{Regerede}} can also be called with the redirects: