Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Outdent

From Summertime Saga Wiki
Revision as of 22:31, 10 July 2020 by Casiope (talk | contribs)

local p = {} local getArgs = require('Module:Arguments').getArgs

function p.outdent (frame) local args = getArgs(frame) local width = 0

if not args[1] then args[1] = end -- un-nil args[1]

width = width + select(2, string.gsub(args[1],':',)) -- increase by 1 for every : width = width + select(2, string.gsub(args[1],'*',)) -- increase by 1 for every * width = width + select(2, string.gsub(args[1],'#',)) * 2 -- increase by 2 for every #

if width == 0 then width = tonumber(args[1]) end -- set width to args[1] if needed

if not width then width = 10 end -- default width if width < 0 then width = -width end if width > 40 then width = 40 end -- max width

width = width * 1.6 -- set width to proper width

local top = '' -- top half local bottom = '' -- bottom half local note = args[2] and '(outdent) ' or -- note

return '

' .. top .. bottom .. note .. '

';

end

return p