Module:කර්තෘ/උපදෙස්
Uses Lua: |
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 {{කර්තෘ}} template.
Unit and integration tests are at Module:කර්තෘ/testcases and their results can be viewed at Module talk:කර්තෘ/testcases.
Function: dates
edit
Get the author-page date string, with categories.
- Usage
- Common usage:
{{#invoke|කර්තෘ|dates}}
- All parameters:
{{#invoke|කර්තෘ|dates|birthyear=|deathyear=|dates=|wikidata_id=}}
- Parameters
-
dates
— if supplied will be used as-is for the date display (however, birthyear and deathyear can still be specified for categorization purposes)birthyear
anddeathyear
— 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"
wikidata_id
— the Wikidata identifier to use. Will default to the current page if not supplied.pagetitle
— a page title to use instead of the current page (only used for testing purposes).
- 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 <br />, and suffixed with the list of appropriate categories (see below).
ප්රවර්ග
editමෙමගින් පිටු පහත ප්රවර්ග වලට ඇතුළු කිරීමද සිදු කරයි:
- In all cases (where applicable):
Category:<year> births
andCategory:<year> deaths
Category:<යුගය> authors
with era defined byModule:යුගය
- Category:Authors with unknown birth dates and Category:Authors with unknown death dates
- Category:Authors with approximate birth dates and Category:Authors with approximate death dates
- Category:උපන් දිනය පිළිබඳ තොරතුරු සපයා නොමැති කතුවරු සහ Category:Authors with missing death dates
- Category:Authors with floruit dates
- Category:Living authors
- Category:Authors with title-date mismatches (if dates are present in the page title and they don't match Wikidata)
- Where manual birth and/or death dates are supplied:
- Category:Authors with override dates (for the
dates
parameter) - Category:Authors with override birth dates and Category:Authors with override death dates
- Category:Authors with non-numeric birth dates and Category:Authors with non-numeric death dates
- Category:Authors with unrecognised birth dates and Category:Authors with unrecognised death dates
- Category:Authors with birth dates differing from Wikidata and Category:Authors with death dates differing from Wikidata
- Category:Authors with override dates (for the
Function: date
edit
Get a single formatted date, with no categories.
- Usage
- Common usage:
{{#invoke|කර්තෘ|date|type=}}
- All parameters:
{{#invoke|කර්තෘ|date|type=|year=|wikidata_id=}}
- Parameters
-
type
— eitherbirth
ordeath
.year
— the year to display, following the same format asbirthyear
in the dates function above.wikidata_id
— the Wikidata Q-identifier of the author to use.
- Returns
- A simple string with no categories or leading or trailing line breaks.
Function: categories
edit
Get a list of categories for occupations and nationalities
- Usage
- All parameters:
{{#invoke|කර්තෘ|categories|wikidata_id=}}
- Returns
- A string containing categories
Function: lastInitial
edit
Get a link to the alphabetical author index page (e.g. Wikisource:Authors-A).
- Usage
- Common usage:
{{#invoke|කර්තෘ|lastInitial |wikidata_id= }}
- All parameters:
{{#invoke|කර්තෘ|lastInitial |wikidata_id= |last_initial= }}
- 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.