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

Content deleted Content added
m Sync
Allow "%year%" variable in description, defaults to "this year" if currYear is nil for w/e reason
Line 50:
['min'] = 0, --integer; lowest possible year (and thus decade) displayed in nav bars; 0/nil defaults to 1758 per ICZN Art. 5
['year'] = { --[[Category:Plants described in 1901]]
['description'] = "This category includes plants that were ''first formally and validly described'' according to the rules of the [[International Code of Botanical Nomenclature]] in this %year%. Use [[WP:RS|reliable sources]] like the [[International Plant Names Index]] to figure out the proper category. For examples see the [[Wikipedia:WikiProject Plants/Description in year categories|WikiProject Plants essay]] on this topic.", --taken from [[Category:Plants described in 1928]]
['parent1'] = 'decade', --[[Category:Plants described in the 1900s]]
['parent2'] = 'Species', --[[Category:Species described in 1900]]
Line 140:
return '' --add err msg/cat?
end
--produce description
description = map[currGroup][currYDC].description
if mw.ustring.match(description, '%%year%%') then
if currYear then description = mw.ustring.gsub(description, '%%year%%', currYear)
else description = mw.ustring.gsub(description, '%%year%%', 'this year') end
end
--produce cats & navs