Difference between revisions of "Template:Births and deaths by year for decade"

From blackwiki
Jump to navigation Jump to search
imported>Pppery
(loop-ify call to transcluding articles with its repetitive dr calls)
imported>Paul2520
(documentation layout)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{for nowiki|
+
{{#ifeq:{{#invoke:String|sub|{{{1|0}}}}|1|1}}|-|{{for nowiki|
 
|<nowiki>== {{ucfirst:{{{1}}}}} ==
 
|<nowiki>== {{ucfirst:{{{1}}}}} ==
 
{{preprocess|{{((}}transcluding articles
 
{{preprocess|{{((}}transcluding articles
   {{!}} {{#ifeq:{{{year}}}|0|{{void|There is no AD year 0}}|{{dr|y|y|{{{year}}}0|0|{{#ifexpr:{{{year}}}<=10|na|n}}}}}}
+
   {{!}} {{for loop|{{!}}|call=Year article|pc1n=1|pc1v={{{decade}}}0|pv=2|-9|-8|-7|-6|-5|-4|-3|-2|-1}}
   {{!}} {{for loop|{{!}}|call=dr|pc1n=1|pc1v=y|pc2n=2|pc2v=y|pc3n=3|pc3v={{{year}}}0|pc4n=5|pc4v={{#ifexpr:{{{year}}}<10|na|n}}|pv=4|1|2|3|4|5|6|7|8|9|10}}
+
   {{!}} {{#ifeq:{{{decade}}}|-0|{{void|There is no BC year 0}}|{{Year article|{{{decade}}}0}}}}
 
{{))}}}}
 
{{))}}}}
{{#ifeq:{{{year}}}|0|{{void|There is no AD year 0}}|
+
{{for loop|
{{Transclude {{{1}}}|{{{year}}}0}}
+
|call=Transclude {{{1}}}|{{{decade}}}9|{{{decade}}}8|{{{decade}}}7|{{{decade}}}6|{{{decade}}}5|{{{decade}}}4|{{{decade}}}3|{{{decade}}}2|{{{decade}}}1}}
 +
{{#ifeq:{{{decade}}}|-0|{{void|There is no BC year 0}}|
 +
{{Transclude {{{1}}}|{{{decade}}}0}}
 +
}}
 +
</nowiki>|births|deaths|decade={{{1|0}}}}}|{{for nowiki|
 +
|<nowiki>== {{ucfirst:{{{1}}}}} ==
 +
{{preprocess|{{((}}transcluding articles
 +
  {{!}} {{#ifeq:{{{decade}}}|0|{{void|There is no AD year 0}}|{{Year article|{{{decade}}}0}}}}
 +
  {{!}} {{for loop|{{!}}|call=Year article|pc1n=1|pc1v={{{decade}}}0|pv=2|1|2|3|4|5|6|7|8|9}}
 +
{{))}}}}
 +
{{#ifeq:{{{decade}}}|0|{{void|There is no AD year 0}}|
 +
{{Transclude {{{1}}}|{{{decade}}}0}}
 
}}
 
}}
 
{{for loop|
 
{{for loop|
|call=Transclude {{{1}}}|{{{year}}}1|{{{year}}}2|{{{year}}}3|{{{year}}}4|{{{year}}}5|{{{year}}}6|{{{year}}}7|{{{year}}}8|{{{year}}}9}}
+
|call=Transclude {{{1}}}|{{{decade}}}1|{{{decade}}}2|{{{decade}}}3|{{{decade}}}4|{{{decade}}}5|{{{decade}}}6|{{{decade}}}7|{{{decade}}}8|{{{decade}}}9}}
</nowiki>|births|deaths|year={{{1|0}}}}}
+
</nowiki>|births|deaths|decade={{{1|0}}}}}}}
 
<noinclude>
 
<noinclude>
 
{{documentation |content=
 
{{documentation |content=
Line 18: Line 29:
 
Negative years use the BC suffix, years 1–100 use the AD prefix, and years above 100 use the plain year number.
 
Negative years use the BC suffix, years 1–100 use the AD prefix, and years above 100 use the plain year number.
 
== Example: the 70s AD ==
 
== Example: the 70s AD ==
{{Births and deaths by year for decade|7}}
+
{{{{PAGENAME}}|7}}
 +
== Example: the 910s AD ==
 +
{{{{PAGENAME}}|91}}
 +
== Example: the 10s BC ==
 +
{{{{PAGENAME}}|-1}}
 +
== Example: the 0s BC ==
 +
{{{{PAGENAME}}|-0}}
 +
== Notes ==
 +
{{notelist}}
 +
 
 
{{template reference list}}
 
{{template reference list}}
{{notelist}}
 
 
}}</noinclude>
 
}}</noinclude>

Latest revision as of 22:33, 17 October 2020

Births

Template:Preprocess

Lua error: expandTemplate: template "Transclude births" does not exist.

Deaths

Template:Preprocess

Lua error: expandTemplate: template "Transclude deaths" does not exist.

Template documentation

Usage

Invoked with a decade as single argument, for example {{Transclude deaths|82}} for the 820s, the template compiles the list of births and deaths from each year article of the decade, by transcluding their "Births" and "Deaths" sections. Empty or non-existent sections are not transcluded. Year numbers are prepended to the transcluded contents with bold pseudo-headers, in order to avoid overloading the transcluding page's table of contents.

Negative years use the BC suffix, years 1–100 use the AD prefix, and years above 100 use the plain year number.

Example: the 70s AD

Births

Template:Preprocess Template:Transclude births Lua error: expandTemplate: template "Transclude births" does not exist.

Deaths

Template:Preprocess Template:Transclude deaths Lua error: expandTemplate: template "Transclude deaths" does not exist.

Example: the 910s AD

Births

Template:Preprocess Template:Transclude births Lua error: expandTemplate: template "Transclude births" does not exist.

Deaths

Template:Preprocess Template:Transclude deaths Lua error: expandTemplate: template "Transclude deaths" does not exist.

Example: the 10s BC

Births

Template:Preprocess Lua error: expandTemplate: template "Transclude births" does not exist. Template:Transclude births

Deaths

Template:Preprocess Lua error: expandTemplate: template "Transclude deaths" does not exist. Template:Transclude deaths

Example: the 0s BC

Births

Template:Preprocess Lua error: expandTemplate: template "Transclude births" does not exist.


Deaths

Template:Preprocess Lua error: expandTemplate: template "Transclude deaths" does not exist.

Notes

References