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

From blackwiki
Jump to navigation Jump to search
imported>Pppery
(Fix expression error)
imported>Pppery
(Prune more duplication, by using the same code for births and deaths in a for nowiki loop. Because of the syntax, the comments needed to be converted to Template:Void)
Line 1: Line 1:
== Births ==
+
{{for nowiki|
 +
|<nowiki>== {{ucfirst:{{{1}}}}} ==
 
{{transcluding articles
 
{{transcluding articles
   | {{#ifeq:{{{1|0}}}|0|<!-- There is no AD year 0 -->|{{dr|y|y|{{{1|0|}}}0|0|{{#ifexpr:{{{1|0}}}<=10|na|n}}}}}}
+
   | {{#ifeq:{{{year}}}|0|{{void|There is no AD year 0}}|{{dr|y|y|{{{year}}}0|0|{{#ifexpr:{{{year}}}<=10|na|n}}}}}}
   | {{dr|y|y|{{{1|0|}}}0|1|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
+
   | {{dr|y|y|{{{year}}}0|1|{{#ifexpr:{{{year}}}<10|na|n}}}}
   | {{dr|y|y|{{{1|0|}}}0|2|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
+
   | {{dr|y|y|{{{year}}}0|2|{{#ifexpr:{{{year}}}<10|na|n}}}}
   | {{dr|y|y|{{{1|0|}}}0|3|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
+
   | {{dr|y|y|{{{year}}}0|3|{{#ifexpr:{{{year}}}<10|na|n}}}}
   | {{dr|y|y|{{{1|0|}}}0|4|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
+
   | {{dr|y|y|{{{year}}}0|4|{{#ifexpr:{{{year}}}<10|na|n}}}}
   | {{dr|y|y|{{{1|0|}}}0|5|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
+
   | {{dr|y|y|{{{year}}}0|5|{{#ifexpr:{{{year}}}<10|na|n}}}}
   | {{dr|y|y|{{{1|0|}}}0|6|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
+
   | {{dr|y|y|{{{year}}}0|6|{{#ifexpr:{{{year}}}<10|na|n}}}}
   | {{dr|y|y|{{{1|0|}}}0|7|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
+
   | {{dr|y|y|{{{year}}}0|7|{{#ifexpr:{{{year}}}<10|na|n}}}}
   | {{dr|y|y|{{{1|0|}}}0|8|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
+
   | {{dr|y|y|{{{year}}}0|8|{{#ifexpr:{{{year}}<10|na|n}}}}
   | {{dr|y|y|{{{1|0|}}}0|9|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
+
   | {{dr|y|y|{{{year}}}0|9|{{#ifexpr:{{{year}}}<10|na|n}}}}
 
}}
 
}}
{{#ifeq:{{{1|0}}}|0|<!-- There is no AD year 0 -->|
+
{{#ifeq:{{{year}}}|0|{{void|There is no AD year 0}}|
{{Transclude births|{{{1|}}}0}}
+
{{Transclude {{{1}}}|{{{year}}}0}}
 
}}
 
}}
 
{{for loop|
 
{{for loop|
|call=Transclude births|{{{1|}}}1|{{{1|}}}2|{{{1|}}}3|{{{1|}}}4|{{{1|}}}5|{{{1|}}}6|{{{1|}}}7|{{{1|}}}8|{{{1|}}}9}}
+
|call=Transclude {{{1}}}|{{{year}}}1|{{{year}}}2|{{{year}}}3|{{{year}}}4|{{{year}}}5|{{{year}}}6|{{{year}}}7|{{{year}}}8|{{{year}}}9}}
== Deaths ==
+
</nowiki>|births|deaths|year={{{1|0}}}}}
{{transcluding articles
 
  | {{#ifeq:{{{1|0}}}|0|<!-- There is no AD year 0 -->|{{dr|y|y|{{{1|0|}}}0|0|{{#ifexpr:{{{1|0}}}<=10|na|n}}}}}}
 
  | {{dr|y|y|{{{1|0|}}}0|1|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
 
  | {{dr|y|y|{{{1|0|}}}0|2|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
 
  | {{dr|y|y|{{{1|0|}}}0|3|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
 
  | {{dr|y|y|{{{1|0|}}}0|4|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
 
  | {{dr|y|y|{{{1|0|}}}0|5|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
 
  | {{dr|y|y|{{{1|0|}}}0|6|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
 
  | {{dr|y|y|{{{1|0|}}}0|7|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
 
  | {{dr|y|y|{{{1|0|}}}0|8|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
 
  | {{dr|y|y|{{{1|0|}}}0|9|{{#ifexpr:{{{1|0}}}<10|na|n}}}}
 
}}
 
{{#ifeq:{{{1|0}}}|0|<!-- There is no AD year 0 -->|
 
{{Transclude deaths|{{{1|}}}0}}
 
}}
 
{{for loop|
 
|call=Transclude deaths|{{{1|}}}1|{{{1|}}}2|{{{1|}}}3|{{{1|}}}4|{{{1|}}}5|{{{1|}}}6|{{{1|}}}7|{{{1|}}}8|{{{1|}}}9}}
 
 
<noinclude>
 
<noinclude>
 
{{documentation |content=
 
{{documentation |content=

Revision as of 19:26, 23 June 2017

Births

Template:Transcluding articles

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

Deaths

Template:Transcluding articles

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:Transcluding articles Template:Transclude births Lua error: expandTemplate: template "Transclude births" does not exist.

Deaths

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


References