Jump to content

Module:Unindent

Unchecked
From Wikipedia

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

p = {}

function p.unindent(frame)
    local pframe = frame:getParent()
    local config = frame.args
    local args = pframe.args

	if tonumber( config[1] ) ~= nil then
		number = tonumber( config[1] )
	elseif string.find( config[1] or '', ':' ) ~= nil then
		number = string.len( config[1] )
	else 
		number = 10
	end

	multiply = number * 3 + 2
    padleft = frame:callParserFunction( 'padleft', { '┘', multiply, '-' } )  -- This should be replaced with an lua function.

    if config[2] then
		link = "\n ([[Template:Outdent|outdent]])"
	else
		link = ''
	end

	return '<span class="outdent-template" style="font-family:DejaVu Sans, sans-serif; color:#808080">┌' .. padleft .. " " .. link .. '</span>\n '
end

return p