Modulo:Vedi anche/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
aggiornato
aggiunta funzione "sezione" per il template "Vedi anche sezione"
Riga 1:
--[[
* Modulo che implementa ille funzionalità dei template {{Vedi anche}} e {{Vedi anche sezione}}.
]]
 
Riga 24:
 
-- Costruisce l'HTML per contenere i wikilink alle pagine.
local function buildHTML(wikitext, with_noprint)
local tableStyle = {
['margin-bottom'] = '.5em',
Riga 34:
local tableNode = mw.html.create('table')
tableNode
:addClass(with_noprint and 'noprint' or nil)
:css(tableStyle)
:tag('tr')
Riga 49:
end
 
-- entryEntry-point per {{Vedi anche sezione}}
function p.sezione(frame)
local arg = frame:getParent().args[1]
local wlink = arg and ("'''[[#" .. arg .. "|" .. arg .. "]]'''") or ''
return buildHTML('sezione ' .. wlink)
end
 
-- Entry-point per {{Vedi anche}}
function p.main(frame)
local args = {}
Line 57 ⟶ 64:
end
 
return buildHTML(mw.text.listToText(args, ', ', ' e '), true)
end