Module:Langtag

From Guild of Archivists
Revision as of 07:26, 30 October 2015 by Alahmnat (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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