Module:NamespaceTable
Appearance
Documentation for this module may be created at Module:NamespaceTable/doc
local p = {}
function p.table(frame)
local pages = frame.args.pages or ""
local list = mw.text.split(pages, "\n")
local out = '{| class="wikitable"\n! Page !! Description\n'
for _, title in ipairs(list) do
title = mw.text.trim(title)
if title ~= "" then
local t = mw.title.new(title)
local desc = ""
if t and t.exists then
-- Get SHORTDESC via page properties
local props = mw.title.new(title):getProperties()
if props and props.shortdesc then
desc = props.shortdesc
end
end
out = out .. '|-\n| [[' .. title .. ']] || ' .. desc .. '\n'
end
end
out = out .. '|}'
return out
end
return p