Module:Headless TOC

From Astrobiology Wiki
Jump to navigation Jump to search

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]
		for k = 1, (tonumber(args.depth) or 1) do
			toc = '=' .. toc .. '='
		end
		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
Cookies help us deliver our services. By using our services, you agree to our use of cookies.