Content deleted Content added
Tom.Reding (talk | contribs) m --ce/update |
Tom.Reding (talk | contribs) --ce, +phab ticket T203355 (Magic word to force category number headings instead of 0-9) |
||
Line 8:
'Spiders' uses year -> decade -> century -> Species.
Any category group (
outlined here in conf{} will follow the 'Fish' tree for that group.
Line 22:
['year'] = { --[[Category:Fish described in 1901]]
['description'] = 'This category should only contain species-level articles.',
['parent1'] = 'century', --
['parent2'] = 'Animals', --[[Category:Animals described in 1901]]
},
Line 169:
local currGroup = mw.ustring.match(currCat, '^%w+') --Fish/Spiders/default/etc.
if conf[currGroup] == nil then conf[currGroup] = conf['Fish'] end --'Fish' == default
local currYDC = nil --possible future values: year/decade/century
local currYear = mw.ustring.match(currCat, 'described in (%d%d%d%d)$')
local currDeca = mw.ustring.match(currCat, 'described in the (%d%d%d%d)s$')
local currCent = mw.ustring.match(currCat, 'described in the (%d+)[snrt][tdh] century$')
local parentDeca = nil --used with currYear (
local parentCent = nil --used with currYear (
local lastCent, nextCent = nil, nil --used with currYear (
local minYear = tonumber(conf[currGroup].yearmin)
if (minYear == nil or (minYear and minYear <= 1700)) then
Line 204:
--conf error checkng (missing keys)
--Numeric sortkeys are unfortunately grouped together under "0-9". Check phab T203355 (Magic word to force category number headings instead of 0-9).
if bConfError == false then
if conf[currGroup] == nil then
Line 260 ⟶ 261:
elseif parent == 'century' then
categories[iparent] = '[[Category:' .. currGroup .. ' described in the ' .. addOrd(parentCent) .. ' century]]'
elseif mw.ustring.match(parent, '^%u%l') then --
categories[iparent] = '[[Category:' .. parent .. ' described in ' .. currYear .. ']]'
else
Line 274 ⟶ 275:
if parent == 'century' then
categories[iparent] = '[[Category:' .. currGroup .. ' described in the ' .. addOrd(parentCent) .. ' century]]'
elseif mw.ustring.match(parent, '^%u%l') then --
categories[iparent] = '[[Category:' .. parent .. ' described in the ' .. currDeca .. 's]]'
else
Line 289 ⟶ 290:
if parent == 'formal' then
categories[iparent] = '[[Category:' .. currGroup .. ' by year of formal description|' .. addOrd(currCent) .. ']]'
elseif mw.ustring.match(parent, '^%u%l') then --
categories[iparent] = '[[Category:' .. parent .. ' described in the ' .. addOrd(currCent) .. ' century]]'
else
|