summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-09-18 14:33:48 +0000
committersanine <sanine.not@pm.me>2023-09-18 14:33:48 +0000
commitef8fcc0889fe217c3170f45644e108ff61e666a0 (patch)
tree20ec61f7a53a1c2a554052f09508cc9e967ba73d
parentea194b4cad05f003b7bad5e7e5f059d745c64995 (diff)
fix reactions and add source code link
-rw-r--r--draw.lua2
-rwxr-xr-xyarrow-ui.cgi11
2 files changed, 10 insertions, 3 deletions
diff --git a/draw.lua b/draw.lua
index 11b4b77..5d39cc5 100644
--- a/draw.lua
+++ b/draw.lua
@@ -296,7 +296,7 @@ function draw(stats, theme)
{base(stats, theme)},
{traits(stats, theme)},
{actions(stats, theme)},
- --{reactions(stats, theme)},
+ {reactions(stats, theme)},
{legendary(stats, theme)}
)
return m.render(m.svg{
diff --git a/yarrow-ui.cgi b/yarrow-ui.cgi
index fffa653..2cbcb6a 100755
--- a/yarrow-ui.cgi
+++ b/yarrow-ui.cgi
@@ -60,10 +60,15 @@ in all of them you can add *italics* and **bold** text!
-- stats yarrow query conversion
+local function clean(str)
+ local str = string.gsub(str, '^%s+', '')
+ local str = string.gsub(str, '%s+$', '')
+ return str
+end
local function parse_traits(str)
local tbl = {}
for name, value in string.gmatch(str, '@([^@]-)\n([^@]+)') do
- table.insert(tbl, {name=name, value=value})
+ table.insert(tbl, {name=clean(name), value=clean(value)})
end
return tbl
end
@@ -76,7 +81,7 @@ local function convert(stats)
end
tbl.traits = parse_traits(stats.traits)
tbl.actions = parse_traits(stats.actions)
- tbl.actions = parse_traits(stats.actions)
+ tbl.reactions = parse_traits(stats.reactions)
if stats.legendary ~= '' then
tbl.legendary = {}
tbl.legendary.description = stats.legendary_description
@@ -190,6 +195,8 @@ end
local body = h('body', {
form_basic,
img,
+ h('hr'),
+ h('a', 'source code', { href='https://sanine.net/git/yarrow' }),
})