Module:siwa-noun: Difference between revisions
No edit summary |
No edit summary |
||
| Line 75: | Line 75: | ||
local args = {} | local args = {} | ||
local sv = parent_args[2] or "a" | local sv = parent_args[2] or "a" | ||
local decl_type = frame.args.decl or detect_decl(sv) | |||
if not m_data[word] then | if not m_data[word] then | ||
if not decl_type then | if not decl_type then | ||
| Line 98: | Line 98: | ||
data.nocat = parent_args["nocat"] and true or false | data.nocat = parent_args["nocat"] and true or false | ||
data.sv = sv or error("Parameter 2 must be the word's stressed vowel") | data.sv = sv or error("Parameter 2 must be the word's stressed vowel") | ||
data.g = parent_args[1] | |||
data.decl_type = decl_type | |||
-- Generate the forms | -- Generate the forms | ||
| Line 168: | Line 170: | ||
end | end | ||
local | local navframe = [=[ | ||
<div class="mw-collapsible" style="border-collapse: collapse; margin: 0px 0px -1px 0px; padding: 2px; border: 1px solid #aaaaaa; text-align: center; font-size: 95%; overflow: auto; width: 70%;"> | <div class="mw-collapsible" style="border-collapse: collapse; margin: 0px 0px -1px 0px; padding: 2px; border: 1px solid #aaaaaa; text-align: center; font-size: 95%; overflow: auto; width: 70%;"> | ||
<div style="min-height: 1.6em; font-weight:bold; font-size: 100%; text-align: left; background-color:#efefef; padding-left: 10px; background-image: -webkit-gradient(linear, left top, left bottom, from(#EFEFEF), to(#DFDFDF), color-stop(0.6, #E3E3E3)); background-image: -moz-linear-gradient(top, #EFEFEF, #E3E3E3 60%, #DFDFDF); background-image: -o-linear-gradient(top, #EFEFEF, #E3E3E3 60%, #DFDFDF);">{{{pagename}}} — {{{gender}}} noun, {{{decl_type}}} | <div style="min-height: 1.6em; font-weight:bold; font-size: 100%; text-align: left; background-color:#efefef; padding-left: 10px; background-image: -webkit-gradient(linear, left top, left bottom, from(#EFEFEF), to(#DFDFDF), color-stop(0.6, #E3E3E3)); background-image: -moz-linear-gradient(top, #EFEFEF, #E3E3E3 60%, #DFDFDF); background-image: -o-linear-gradient(top, #EFEFEF, #E3E3E3 60%, #DFDFDF);">{{{pagename}}} — {{{gender}}} noun, {{{decl_type}}} | ||
</div> | </div> | ||
<div class="mw-collapsible-content" style="font-size: 100%;"> | <div class="mw-collapsible-content" style="font-size: 100%;"> | ||
]=] | |||
local inanimate = [=[ | |||
{| class="greentable" border="1px #aaaaaa solid" margin="1em 1em 1em 0" style="background: #f9f9f9; border-collapse: collapse;" width="100%" | {| class="greentable" border="1px #aaaaaa solid" margin="1em 1em 1em 0" style="background: #f9f9f9; border-collapse: collapse;" width="100%" | ||
|- | |- | ||
| Line 181: | Line 186: | ||
|}]=] | |}]=] | ||
local wikicode = navframe .. (data.g == "i" and inanimate or animate) | |||
return gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl) .. (not data.nocat and m_u.format_categories(data.categories, lang) or "") | return gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl) .. (not data.nocat and m_u.format_categories(data.categories, lang) or "") | ||