Module:GetRandomCreature: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local colorparse = require'Module:ColorParse' | |||
function p. | function p.qudlook(frame) | ||
local bordercolor | |||
local padding | |||
local bottomtext | |||
local | |||
--[Determine border color]-- | |||
--[ | local bordercolorin = frame.args['bordercolor'] | ||
if bordercolorin == nil or bordercolorin == 'c' then | |||
local | bordercolor = '' | ||
elseif bordercolorin == 'y' then | |||
bordercolor='white-border' | |||
else | |||
error('bordercolor not set to either "c" or "y"',0) | |||
end | end | ||
--[Determine Title Color]-- | |||
local titlein= frame.args['title'] | |||
local title = colorparse.parse('&y'.. titlein) | |||
--[Determine qud text]-- | |||
local text = frame.args['text'] | |||
local qudtext = frame:extensionTag{ name='poem', content=colorparse.parse('&y' .. text) } | |||
--[Determine body padding]-- | |||
local paddingin = frame.args['padding'] | |||
if paddingin == nil or paddingin == '' then | |||
padding = '1.5' | |||
else | |||
padding = paddingin | |||
end | end | ||
--[Determine bottomtext]-- | |||
-- | local bottomin = frame.args['bottomtext'] | ||
local | if bottomin == nil or bottomin == '' then | ||
bottomtext= 'Perfect' | |||
elseif bottomin == 'none' then | |||
bottomtext= '' | |||
else | |||
bottomtext= bottomin | |||
end | end | ||
local parsedbottomtext=colorparse.parse('&Y'..bottomtext) | |||
--[Return html]-- | |||
local html = { | |||
'<div class="qud-box-wrapper' ..bordercolor..'">', | |||
'<div class="qud-box">', | |||
'<span class="qud-box-header"><b>' .. title .. '</b></span>', | |||
'<div class="qud-box-content" style="font-weight:bold; line-height:1.5em; padding:0em '..padding..'em;">'..qudtext..'</div>', | |||
'<span class="qud-box-footer-left">'..parsedbottomtext..'</span></div></div>' | |||
} | |||
return html .. '\n' | |||
end | end | ||
return p | |||
p |
Revision as of 22:12, 8 August 2019
Documentation for this module may be created at Module:GetRandomCreature/doc
local p = {}
local colorparse = require'Module:ColorParse'
function p.qudlook(frame)
local bordercolor
local padding
local bottomtext
--[Determine border color]--
local bordercolorin = frame.args['bordercolor']
if bordercolorin == nil or bordercolorin == 'c' then
bordercolor = ''
elseif bordercolorin == 'y' then
bordercolor='white-border'
else
error('bordercolor not set to either "c" or "y"',0)
end
--[Determine Title Color]--
local titlein= frame.args['title']
local title = colorparse.parse('&y'.. titlein)
--[Determine qud text]--
local text = frame.args['text']
local qudtext = frame:extensionTag{ name='poem', content=colorparse.parse('&y' .. text) }
--[Determine body padding]--
local paddingin = frame.args['padding']
if paddingin == nil or paddingin == '' then
padding = '1.5'
else
padding = paddingin
end
--[Determine bottomtext]--
local bottomin = frame.args['bottomtext']
if bottomin == nil or bottomin == '' then
bottomtext= 'Perfect'
elseif bottomin == 'none' then
bottomtext= ''
else
bottomtext= bottomin
end
local parsedbottomtext=colorparse.parse('&Y'..bottomtext)
--[Return html]--
local html = {
'<div class="qud-box-wrapper' ..bordercolor..'">',
'<div class="qud-box">',
'<span class="qud-box-header"><b>' .. title .. '</b></span>',
'<div class="qud-box-content" style="font-weight:bold; line-height:1.5em; padding:0em '..padding..'em;">'..qudtext..'</div>',
'<span class="qud-box-footer-left">'..parsedbottomtext..'</span></div></div>'
}
return html .. '\n'
end
return p