Module:qlu-nouns: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 177: Line 177:
return data.forms[key] or "—"
return data.forms[key] or "—"
end
end
local case_order = {"dative", "genitive", "accusative", "nominative"}


local out = {}
local out = {}
table.insert(out, '{| class="wikitable"\n! Case !! Singular !! Plural')
-- Table start with styled header row: dark gray background, white text
table.insert(out, '{| class="wikitable" style="border-collapse:collapse; width: 40%;"')
table.insert(out, '! style="background:#444; color:white; padding:4px;" | Case')
table.insert(out, '! style="background:#444; color:white; padding:4px;" | Singular')
table.insert(out, '! style="background:#444; color:white; padding:4px;" | Plural')


for case, info in pairs(cases) do
for _, case in ipairs(case_order) do
table.insert(out, string.format('|-\n| %s || %s || %s', info.link, showForm(case, "sg"), showForm(case, "pl")))
local case_name = cases[case].link:gsub("''", "") -- Remove italics to style ourselves
-- Case name column with light gray background, forms with white background
table.insert(out, string.format('|-\n| style="background:#ddd; padding:4px;" | %s || style="background:#fff; padding:4px;" | %s || style="background:#fff; padding:4px;" | %s',
case_name, showForm(case, "sg"), showForm(case, "pl")))
end
end


table.insert(out, '|}')
table.insert(out, '|}')
return table.concat(out, '\n')
return table.concat(out, '\n')
end
end


return export
return export
1,849

edits

Navigation menu