Module:Langtag: Difference between revisions

From Guild of Archivists
No edit summary
 
m (1 revision imported)
 

Latest revision as of 07:26, 30 October 2015

Documentation for this module may be created at Module:Langtag/doc

-- This is an experiment in writing a Lua module/template
-- It's supposed to create some text in a span tag with a lang attribute

local p = {}

function p.span(frame)
    frame.args.tag = 'span';
    return p.tag(frame);
end

function p.tag(frame)
    return '<' .. frame.args.tag .. ' lang="' .. frame.args.code .. '">' .. frame.args.text .. '</span>';
end

return p