local getArgs = require('Module:Arguments').getArgslocal yesno = require('Module:Yesno')local Date = require('Module:Date')._Date
-- TODO use TemplateStyles
p =
local function wikiError(message) local ret = mw.html.create('div') :addClass('error') :wikitext(message) return tostring(ret)end
-- replace all newlines in the string with break tags-- slideshow only supports single line captionslocal function replaceNewlines(s) return mw.ustring.gsub(s, '%c', 'XXXX')end
-- Extract value named "paramName" from a subpage of local function getPotdPart(frame, potdSubpage, paramName) return frame:expandTemplateend
-- bottom half of for a POTD subpagelocal function getPotdText(frame, potdDate, moreHtml) local potdText = getPotdPart(frame, "POTD/" .. potdDate, "portal layout/text") mw.log(potdText) local debugText = "
BEFORE: " .. potdText potdText = replaceNewlines(potdText) debugText = debugText .. "
AFTER: " .. potdText mw.log(potdText) mw.log("---------------------------") if moreHtml then potdText = potdText .. moreHtml .. debugText end return potdTextend
function main(frame) local root = getPotdText(frame, "2013-10-18", "xyzzy") return frame:preprocess(root)end
p.main = main
return p