Modulo:Link-FormeFlesse
⧼vector-jumptonavigation⧽
⧼vector-jumptosearch⧽
La documentazione per questo modulo può essere creata in Modulo:Link-FormeFlesse/man
local getArgs = require('Modulo:Arguments').getArgs local function categorizza(cat) return string.format('[[%s:%s]]', mw.site.namespaces[14].name, cat) end local function titleExists(pagina) local title = mw.title.new(pagina) return title and title.exists end local p = {} local function main (frame) local forme = {} local arg = getArgs(frame) local categoria for i, j in pairs(arg) do if titleExists(mw.text.trim(j)) == false then categoria = ''..categorizza('Lemmi con forme flesse da scrivere') else categoria = '' end local link = '[['..mw.text.trim(j)..']]' table.insert(forme, link) end if (#forme) == 0 then modifica = ' ['..mw.title.getCurrentTitle():fullUrl{action = 'edit'}..' correggi il template]' return '<strong class="error plainlinks">non specificato,'..modifica..'</strong>'..categorizza('Template per le forme flesse senza informazioni') end return ''..table.concat(forme,', ')..''..categoria end function p.plurale(frame) local arg = getArgs(frame) if arg[1] == 'inv' or arg[1] == 'invariabile' then return '(\'\'invariabile\'\')' else return '(\'\'pl\'\': '.. main(frame,forme)..')' end end function p.femminile (frame) local arg = getArgs(frame) if arg[1] == 'inv' or arg[1] == 'invariabile' then return '(\'\'invariabile\'\')' else return '(\'\'f\'\': '.. main(frame,forme)..')' end end function p.neutro (frame) local arg = getArgs(frame) return '(\'\'n\'\': '.. main(frame,forme)..')' end function p.genitivo (frame) local arg = getArgs(frame) if arg[1] == 'inv' or arg[1] == 'invariabile' then return '(\'\'invariabile\'\')' elseif arg[1] == 'no' then return '(\'\'solo singolare)' else return '(\'\'genitivo\'\': '.. main(frame,forme)..')' end end return p