Module:User:Vampyricon/txb-noun/table

local export = {}

local Array = require 'Module:array'

local function add_forms(wikitable, forms) if type(wikitable) ~= 'string' then error('Expected string, got ' .. type(wikitable)) end wikitable = wikitable:gsub('}', forms) return wikitable end

local stylesheet = require("Module:TemplateStyles")("Template:User:Vampyricon/txb-decl-1st/style.css")

function export.make_table_sg(data) local output = Array(data.title, stylesheet) output:insert [=[

{| class="wikitable inflection-table inflection-table-txb" ! class="corner-header" | Case ! class="number-header" | Singular ! class="case-header" | Nominative ! class="case-header" | Genitive ! class="case-header" | Oblique ! class="case-header" | Ablative ! class="case-header" | Allative ! class="case-header" | Perlative ! class="case-header" | Locative ! class="case-header" | Comitative output:insert('\n|}') if data.footnotes and data.footnotes ~= "" then output:insert('\n' .. data.footnotes) end
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * -]=]

return add_forms(output:concat, data.forms) end

function export.make_table_pl(data) local output = Array(data.title, stylesheet) output:insert [=[

{| class="wikitable inflection-table inflection-table-txb" ! class="corner-header" | Case ! class="number-header" | Plural ! class="case-header" | Nominative ! class="case-header" | Genitive ! class="case-header" | Oblique ! class="case-header" | Ablative ! class="case-header" | Allative ! class="case-header" | Perlative ! class="case-header" | Locative ! class="case-header" | Comitative output:insert('\n|}') if data.footnotes and data.footnotes ~= "" then output:insert('\n' .. data.footnotes) end return add_forms(output:concat, data.forms) end
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * -]=]

function export.make_table(data) local output = Array(data.title, stylesheet) output:insert [=[

{| class="wikitable inflection-table inflection-table-txb" ! class="corner-header" | Case ! class="number-header" | Singular ! class="number-header" | Plural ! class="case-header" | Nominative ! class="case-header" | Vocative ! class="case-header" | Genitive ! class="case-header" | Accusative ! class="case-header" | Perlative ! class="case-header" | Comitative ! class="case-header" | Allative ! class="case-header" | Ablative ! class="case-header" | Locative ! class="case-header" | Causative output:insert('\n|}') if data.footnotes and data.footnotes ~= "" then output:insert('\n' .. data.footnotes) end return add_forms(output:concat, data.forms) end
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * class="form-cell" |
 * -]=]

return export