Content deleted Content added
m added a todo item in the intro comments |
m Protected "Module:LDSverse": request at RfPP ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indefinite)) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 432:
wikiText = wikiText .. "]]" -- DON'T FORGET!!!
return wikiText
end
-- like the name says, this just counts the number of keys (aka indexes) in a table
local function countKeys(t)
local i = 0
for k,v in pairs(t) do i = i+1 end
return i
end
-- returns a (collapsed by default) wikitable listing all the aliases for every book
-- designed for use on the {{LDS}} template documentation page
function p.getBookAliasesWikiTable()
local wikiTable = [[{| class="wikitable sortable mw-collapsible mw-collapsed"
|+ class="nowrap" |LDS Template Book Name Aliases
! Standard Work !! Book !! Aliases
]]
for sw, bookList in pairs(standardWorks) do
wikiTable = wikiTable .. '|-\n|rowspan="' .. countKeys(bookList) .. '"|' .. sw .. "\n"
for book, aliases in pairs(bookList) do
wikiTable = wikiTable .. "| " .. book .. "\n| " .. table.concat(aliases, ", ") .. "\n|-\n"
end
end
wikiTable = wikiTable .. "|}"
return wikiTable
end
|