Module:Langtag

From Guild of Archivists

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