Module:Category described in year/sandbox: Difference between revisions

Content deleted Content added
m Fix regex
+Fossil taxa tree
Line 5:
--[[============================================================================
Any category group (e.g. Bacteria/Plants/etc.) NOT explicitly outlined here
in conf{} will follow the 'Default' tree for that group when the template is
used on that cateogry.
Line 14:
Decadal categories are discouraged.
To create a new tree, only if necessarily different from the default, copy an existing
an existing tree and paste it in an appropriate spot in the conf{} table, following the
following the same general table format, and updating any group-specific
variables.
============================================================================]]--
Line 258 ⟶ 259:
--[[==================== "Fossil taxa described in"-level ====================]]
['SpeciesFossil taxa'] = {
['year'] = { --[[Category:SpeciesFossil taxa described in 1901]]
['parent1'] = 'century', --[[Category:SpeciesFossil taxa described in the 20th century]]
['sortkey1'] = ' ',
['parent2'] = 'Taxa', --[[Category:Taxa described in 1901]]
['parent3'] = 'environmentpaleontology', --[[Category:1901 in the environmentpaleontology]]
['description'] = '',This category should only contain articles on fossil --Year[[genus|genera]] descriptionor tbdlower.',
},
['century'] = { --[[Category:SpeciesFossil taxa described in the 20th century]]
['parent1'] = 'formal', --[[Category:SpeciesFossil taxa by year of formal description]]
['parent2'] = 'Taxa', --[[Category:Taxa described in the 20th century]]
['parent3'] = 'environmentpaleontology', --[[Category:20th century in the environmentpaleontology]]
['description'] = '', --Century description tbd
['description'] = "This category should only contain '''[[species]]''' and notable [[subspecies]] of [[Biota (taxonomy)|biota]] described in the '''[[%century% century]]'''.", --adapted from all 4 Species-century cats (18th-21st)
},
},
Line 497 ⟶ 498:
categories[iparent] = '[[Category:'..currYear..' in science'..sortkey..']]' --biology cat structure doesn't exist pre-1865, as of 10/2018
else
categories[iparent] = '[[Category:'..currYear..' in biology'..sortkey..']]' --if/when all biology cats exists, merge this elseif with 'paleontology'
end
elseif parent == 'environment' then
Line 503 ⟶ 504:
else sortkey = '|'..sortkey end
categories[iparent] = '[[Category:'..currYear..' in the environment'..sortkey..']]'
elseif parent == 'paleontology' then
if isNilOrEmpty(sortkey) then sortkey = '' --default to none
else sortkey = '|'..sortkey end
categories[iparent] = '[[Category:'..currYear..' in '..parent..sortkey..']]'
elseif mw.ustring.match(parent, '^%u%l') then --e.g. Animals/Insects
if isNilOrEmpty(sortkey) then sortkey = '' --default to none
Line 538 ⟶ 543:
if isNilOrEmpty(sortkey) then sortkey = addOrd(currCent) end --default to currCent
categories[iparent] = '[[Category:'..currGroup..' by year of formal description|'..sortkey..']]'
elseif parent == 'biology' or parent == 'paleontology' then
if isNilOrEmpty(sortkey) then sortkey = '' --default to none
else sortkey = '|'..sortkey end
categories[iparent] = '[[Category:'..addOrd(currCent)..' century in biology'..parent..sortkey..']]'
elseif parent == 'environment' then
if isNilOrEmpty(sortkey) then sortkey = '' --default to none