Module:Japanese calendar/doc
< Module:Japanese calendar
Jump to navigation
Jump to search
Revision as of 11:34, 22 August 2013 by blackwiki>Mr. Stradivarius (make a start)
This is the documentation page for Module:Japanese calendar
| This module is rated as alpha. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome. |
This module is used to calculate dates in the Japanese calendar. It defines an "era" class which is designed to be called from other Lua modules, and it also contains several functions to export Japanese calendar data directly to Wikipedia pages through #invoke.
Usage
Through #invoke
{{#invoke:Japanese calendar|function_name|year=year|article=article|kanji=kanji}}
The function name specifies how the data should be outputted. The year, article, and kanji parameters determine what era and year the module outputs.
- Functions
| Code | Description | Example |
|---|---|---|
baseyear |
The first year of the specified era. | {{#invoke:Japanese calendar|baseyear|article=Heisei}} →
|
year |
The year for the specified era, without the era name. | {{#invoke:Japanese calendar|year|year=1989}} → 1
|
kanjiyear |
The same as year, but in kanji. Only affects the first year of an era. |
{{#invoke:Japanese calendar|kanjiyear|year=1989}} → 元
|
article |
The Wikipedia article for the era, unlinked. | {{#invoke:Japanese calendar|article|year=1950}} → Shōwa period
|
label |
The name of the era. Same as article for undisambiguated titles. |
{{#invoke:Japanese calendar|label|year=1950}} → Shōwa
|
link |
A link to the Wikipedia article of the specified era. | {{#invoke:Japanese calendar|link|year=1950}} → Shōwa
|
kanji |
The kanji for the specified era. | {{#invoke:Japanese calendar|kanji|year=1950}} → 昭和
|
label_year |
label followed by year |
{{#invoke:Japanese calendar|label_year|year=1989}} → Heisei 1
|
link_year |
link followed by year |
{{#invoke:Japanese calendar|link_year|year=1989}} → Heisei 1
|
label_kanjiyear |
label followed by kanjiyear |
{{#invoke:Japanese calendar|label_kanjiyear|year=1989}} → Heisei 元
|
link_kanjiyear |
link followed by kanjiyear |
{{#invoke:Japanese calendar|link_kanjiyear|year=1989}} → Heisei 元
|