Difference between revisions 40111 and 40112 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)    local cat
    if sort ~= nil then cat = "[[category:Italian nouns|" .. sort .. "]]"
        else cat = "[[category:Italian nouns]]"
    end
    return headword .. cat
end

function p.
alts(x,ywiki(x)
-- For use within p.itconj function.
-- Wikifies term, then a.
    if x ~= "" then return "[[" .. x .. "]]" end
    return x
end

function p.alts(x,y)
-- For use within p.itconj function.
-- Adds alternate forms with a comma in between.
    if x ~= "" then x = "[[" .. x .. "]]" end
    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()
(contracted; show full)    conj = conj .. '|-\n'    
    
    conj = conj .. '|}</div></div>'
    return conj
    
end

return p