Module:Author/doc

This module handles logic for pages in the Author namespace and in portals about individual people. It uses Wikidata where possible, and allows local override of all parameters. It is used by the author template, Module:Person and Module:Disambiguation.

Unit and integration tests are at Module:Author/testcases and their results can be viewed at Module talk:Author/testcases.

Function:
Get the author-page date string, with categories.


 * Usage:
 * Common usage:
 * All parameters:


 * Parameters:
 * — if supplied will be used as-is for the date display (however, birthyear and deathyear can still be specified for categorization purposes)
 * and  — the years of birth and death, in this format:
 * a numeric year
 * "?" or empty for unknown (or still alive)
 * use BCE for years before year 1
 * Approximate dates:
 * Decades or centuries: "1930s" or "20th century"
 * Circa: "c/1930" or "c. 1930" or "ca 1930" or "circa 1930"
 * Tenuous year: "1932/?"
 * Choice of two or more years: "1932/1933"
 * — the Wikidata identifier to use. Will default to the current page if not supplied.
 * — a page title to use instead of the current page (only used for testing purposes).

, and suffixed with the list of appropriate categories (see below).
 * Returns:
 * This function returns the author's birth and death years, wrapped in parentheses and separated by an en dash. The return string is prefixed with a

Categories
This function also adds pages to the following categories:


 * 1) In all cases (where applicable):
 * 2) *  and
 * 3) *  with era defined by
 * 4) * Category:Authors with unknown birth dates‎ and Category:Authors with unknown death dates‎
 * 5) * Category:Authors with approximate birth dates and Category:Authors with approximate death dates
 * 6) * Category:Authors with missing birth dates‎ and Category:Authors with missing death dates‎
 * 7) * Category:Authors with floruit dates
 * 8) * Category:Living authors
 * 9) * Category:Authors with title-date mismatches (if dates are present in the page title and they don't match Wikidata)
 * 10) Where manual birth and/or death dates are supplied:
 * 11) * Category:Authors with override dates (for the  parameter)
 * 12) * Category:Authors with override birth dates and Category:Authors with override death dates
 * 13) * Category:Authors with non-numeric birth dates and Category:Authors with non-numeric death dates
 * 14) * Category:Authors with unrecognised birth dates and Category:Authors with unrecognised death dates
 * 15) * Category:Authors with birth dates differing from Wikidata and Category:Authors with death dates differing from Wikidata

Function:
Get a single formatted date, with no categories.


 * Usage:
 * Common usage:
 * All parameters:


 * Parameters:
 * — either  or.
 * — the year to display, following the same format as  in the dates function above.
 * — the Wikidata Q-identifier of the author to use.


 * Returns:
 * A simple string with no categories or leading or trailing line breaks.

Function:
Get a list of categories for occupations and nationalities


 * Usage:
 * All parameters:


 * Returns:
 * A string containing categories

Function:
Get a link to the alphabetical author index page (e.g. Authors-A).


 * Usage:
 * Common usage:
 * All parameters:


 * Parameters:
 * wikidata_id — the Wikidata Q-identifier of the author to use.
 * last_initial — manually-specified override for the initial letters. Means that wikidata_id will be ignored.


 * Returns:
 * A wikitext string containing a link (if appropriate) and a category.