Module:Headless TOC
From EverybodyWiki Bios & Wiki
Documentation for this module may be created at Module:Headless TOC/doc
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {trim = false})
if args[1] or args[2] then
local toc = args[2] or args[1]
local equals = ('='):rep(tonumber(args.depth) or 1)
toc = equals .. toc .. equals
return '<div style="overflow:hidden;width:2px;height:2px;margin:-1px;display:inline-block;vertical-align:text-top;position:relative;top:-1em;">\n==' .. toc .. '==\n</div><div style="display:inline-block;margin:0;margin-left:-.625ex;">' .. (args[1] or '') .. '</div>'
end
return 'Missing arguments {{{1}}} and {{{2}}}'
end
return p
