Difference between revisions 40041 and 40042 on test2wiki

-- This is a test of scribbling. Using Italian templates from en.wiktionary.
-- Owner SemperBlotto
local p = {}

function p.itadj(frame)
    local pframe = frame:getParent()
    local args = pframe.args
    local stem = args[1] or error("1st parameter (stem of adjective) missing!")
(contracted; show full)-- For use within p.itconj function.
-- Adds alternate forms to the main one with a comma in between.
    if y ~= nil then return x .. ", " .. y end
    return x
end

function p.itconj(frame)

-- This function builds pretty tables for Italian verb conjugation.
-- It is called by other templates/functions for regular verbs, and called directly for some irregular ones.
    local pframe = frame:getParent()
    local args = pframe.args
    local inf = args["inf"] or error("Infinitive missing!")
    local aux = args["aux"] or "avere"
    local ger = args["ger"]
    local ger2 = args["ger2"]
    ger = p.alts(ger, ger2)
    local presp = args["presp"]
(contracted; show full)
    conj = conj .. '! style="background:#c0cfe4" | io\n'
    conj = conj .. '! style="background:#c0cfe4" | tu\n'
    conj = conj .. '! style="background:#c0cfe4" | lui/lei\n'
    conj = conj .. '! style="background:#c0cfe4" | noi\n'
    conj = conj .. '! style="background:#c0cfe4" | voi\n'
    conj = conj .. '! style="background:#c0cfe4" | essi/esse\n|-\n'
    


conj = conj .. '! style="height:3em;background:#c0cfe4" colspan="1" | present\n'
    conj = conj .. '|' .. pres1s .. '|' .. pres2s .. '|' .. pres3s .. '|' .. pres1p .. '|' .. pres2p .. '|' .. pres3p
        
    
    conj = conj .. '|}</div></div>'
    return conj
end

return p