Content deleted Content added
Tom.Reding (talk | contribs) m Sync |
Tom.Reding (talk | contribs) m Merge 2 related if's; --ce; var ce |
||
Line 298:
}
--[[==========================================================================]]
--[[ Local functions ]]
--[[==========================================================================]]
local function addOrd( i ) --20 -> 20th, etc.
Line 318 ⟶ 322:
local p = {}
--[[==========================================================================]]
--[[ External function ]]
--[[==========================================================================]]
function p.autodetect( frame )
local currentTitle = mw.title.getCurrentTitle()
Line 422 ⟶ 430:
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
local parentDeca, parentCent = nil, nil --used with currYear & currDeca
local minYear = tonumber(conf[currGroup].yearmin)
if (minYear == nil or (minYear and minYear <= 1700)) then
Line 474 ⟶ 481:
end
if bConfError == false then
--produce portal
if currGroup == 'Fossil taxa' then
portal = frame:expandTemplate{ title = 'Portal', args = { 'Paleontology' } }
end
--produce description
description = conf[currGroup][currYDC].description
if mw.ustring.match(description, '%%year%%') then
Line 496 ⟶ 502:
end
--produce toc
if mw.site.stats.pagesInCategory(currCat, 'pages') >= conf['tocmin'] then --expensive
local args = { numerals = 'no' }
toc = frame:expandTemplate{ title = 'Category TOC', args = args }
end
--produce cats & navs▼
▲ --produce cats & navs
local iparent = 1
local parenti = 'parent' .. iparent
|