Module:Storm categories/demo: Difference between revisions

Content deleted Content added
m reword warning text
add plain display mode
Line 31:
-- @param frame The Scribunto frame.
function p.demo(frame)
local plain = (frame.args["plain"] or frame:getParent().args["plain"] or "") ~= ""
local legend = setmetatable({}, { refgroupname = "" })
local errors = setmetatable({}, { refgroupname = "E" })
Line 64 ⟶ 66:
-- <ref name="hash"/>
return plain and "" or frame:extensionTag{ name = 'ref', args = {
name = hash,
group = getmetatable(group)["refgroupname"]
Line 283 ⟶ 285:
out = ""
if not plain and not tableEmpty(errors) then
out = out
.. tostring(mw.html.create("h4"):wikitext("Error"))
Line 289 ⟶ 291:
.. buildReflist(errors)
end
if not plain and not tableEmpty(legend) then
out = out
.. tostring(mw.html.create("h4"):wikitext("Legend"))
Line 295 ⟶ 297:
end
out = out .. tostring(categoryTable)
if not plain and not tableEmpty(warnings) then
out = out
.. tostring(mw.html.create("h4"):wikitext("Warnings"))