Modulo:AIRBox

Da Wiki Acquisti in rete PA.
Versione del 29 mag 2023 alle 10:58 di Acquisti in Rete (discussione | contributi) (Creata pagina con "-- Nome del modulo: AIRBox local p = {} function p.renderBox(args) local titolo = args.titolo or "Da sapere che" local testo = args.testo or "" local icona = args.icona or "" local output = mw.html.create('div') output:addClass('multibox') if titolo ~= "notitolo" then local header = mw.html.create('div') header:addClass('box-header') header:wikitext(titolo) output:node(header) end local body = mw.html.c...")
(diff) ← Versione meno recente | Versione attuale (diff) | Versione più recente → (diff)

La documentazione per questo modulo può essere creata in Modulo:AIRBox/man

-- Nome del modulo: AIRBox

local p = {}

function p.renderBox(args)
    local titolo = args.titolo or "Da sapere che"
    local testo = args.testo or ""
    local icona = args.icona or ""

    local output = mw.html.create('div')
    output:addClass('multibox')

    if titolo ~= "notitolo" then
        local header = mw.html.create('div')
        header:addClass('box-header')
        header:wikitext(titolo)
        output:node(header)
    end

    local body = mw.html.create('div')
    body:addClass('box-body')

    if icona ~= "" then
        local icon = mw.html.create('div')
        icon:addClass('box-icon')
        icon:wikitext(icona)
        body:node(icon)
    end

    body:wikitext(testo)
    output:node(body)

    return tostring(output)
end

return p