Module:Category described in year and Module:Category described in year/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
Tom.Reding (talk | contribs) m config |
Tom.Reding (talk | contribs) m ce |
||
Line 31: | Line 31: | ||
function p.autodetect( frame ) |
function p.autodetect( frame ) |
||
local conf = require( 'Module:Category described in year/ |
local conf = require( 'Module:Category described in year/conf/sandbox' ) --configuration module |
||
local commonsLink = require('Module:Commons link') |
local commonsLink = require('Module:Commons link') |
||
local currentTitle = mw.title.getCurrentTitle() |
local currentTitle = mw.title.getCurrentTitle() |
||
Line 324: | Line 324: | ||
end --if currCat then |
end --if currCat then |
||
--build header |
--build header |
||
local br = '<br />' |
local br = '<br />' |
||
local n = '\n' |
|||
if nav then header = nav end |
if nav then header = nav end |
||
if portal then header = header.. |
if portal then header = header..n..portal end |
||
if commons then header = header.. |
if commons then header = header..n..commons end |
||
if wikispecies then header = header.. |
if wikispecies then header = header..n..wikispecies end |
||
if description and description ~= '' then |
if description and description ~= '' then |
||
header = header..description |
header = header..description |
||
elseif portal or commons or wikispecies then |
elseif portal or commons or wikispecies then |
||
header = mw.ustring.gsub(header, |
header = mw.ustring.gsub(header, br, '') |
||
end |
end |
||
if toc then header = header..br..toc end |
if toc then header = header..br..toc end |
||
--rem surrounding whitespace |
|||
header = mw.text.trim(header) |
header = mw.text.trim(header) |
||
header = mw.ustring.gsub(header, '^ |
header = mw.ustring.gsub(header, '^'..br, '') |
||
header = mw.ustring.gsub(header, |
header = mw.ustring.gsub(header, br..'$', '') |
||
--append header to outString |
--append header to outString |