Template:Categories by date/doc

Normal usage
All templates using the system have identical usage. The output will change depending on what information you provide it:
 * year categories: provide the century, decade, and year digits;
 * decade categories: provide the century and decade digits;
 * century categories: provide the century digit.

Examples: 1985 (year):

1980s (decade):

20th century:

50:

1250s BCE (decade):

1st century
Two slight changes are needed for the first century and first decade categories, because the digits normally given to the template aren't there (for example, there is no decade digit for year 5).

Decade one (years 1–9):

First century category:

For coders
Note: This template is not intended to be used directly by editors; if you are looking for documentation on a template like, see For editors above. Currently, the following templates use this system:
 * births by year
 * deaths by year
 * works by year

Usage
This template is used as part of specific templates like to generate lists of dated categories (century, decades, years). It deduces the depth from how much information is provided. The code below is standard (change values as appropriate):


 * ,, : The date split into century, decade, and year digits.
 * : The text used as part of the category description (for example, "{caption} in the year 1986").
 * : The text used in the categories (for example, ).
 * : The parent category that contains the current dated categories system.
 * : toggles whether to add "BCE" to the category names.

Nested template
This template makes use of the nested template to generate lists of categories. This nested templates manipulates parameters in such a way as to minimize computation:
 * (prefix digits): the digits of the year, excepting the last number.
 * (suffix): text to add after the date; for example, s in 1980s works.
 * (category label): the text in the category names; for example, works in 1980 works.
 * (era): BCE if in that era.