diff options
author | Volpeon <git@volpeon.ink> | 2022-08-02 20:56:45 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2022-08-02 20:56:45 +0200 |
commit | 944a735c39a27fc86569c585f2805837b61adb60 (patch) | |
tree | c35f9e0c834c35a395aa58edbcebd8b5e9c83d70 /filters | |
parent | Style fix for card list 'list' layout gap on <=sm (diff) | |
download | volpeon.ink-944a735c39a27fc86569c585f2805837b61adb60.tar.gz volpeon.ink-944a735c39a27fc86569c585f2805837b61adb60.tar.bz2 volpeon.ink-944a735c39a27fc86569c585f2805837b61adb60.zip |
Slightly tidied up metadata handling
Diffstat (limited to 'filters')
-rw-r--r-- | filters/lib/common.lua | 26 | ||||
-rw-r--r-- | filters/vars.lua | 2 |
2 files changed, 2 insertions, 26 deletions
diff --git a/filters/lib/common.lua b/filters/lib/common.lua index 4d44ff3..d6f92e0 100644 --- a/filters/lib/common.lua +++ b/filters/lib/common.lua | |||
@@ -12,30 +12,6 @@ function wide(el) | |||
12 | return els | 12 | return els |
13 | end | 13 | end |
14 | 14 | ||
15 | function dump(o) | ||
16 | if type(o) == 'table' then | ||
17 | local s = '{ ' | ||
18 | for k, v in pairs(o) do | ||
19 | if type(k) ~= 'number' then k = '"' .. k .. '"' end | ||
20 | s = s .. '[' .. k .. '] = ' .. dump(v) .. ',' | ||
21 | end | ||
22 | return s .. '} ' | ||
23 | else | ||
24 | return tostring(o) | ||
25 | end | ||
26 | end | ||
27 | |||
28 | function string.split(str, sep) | ||
29 | sep = sep or '%s' | ||
30 | |||
31 | local parts = pandoc.List() | ||
32 | |||
33 | for field, s in str:gmatch("([^" .. sep .. "]*)(" .. sep .. "?)") do | ||
34 | parts:insert(field) | ||
35 | if s == "" then return parts end | ||
36 | end | ||
37 | end | ||
38 | |||
39 | return { | 15 | return { |
40 | wide = wide, dump = dump | 16 | wide = wide |
41 | } | 17 | } |
diff --git a/filters/vars.lua b/filters/vars.lua index b0fa66c..99cedc4 100644 --- a/filters/vars.lua +++ b/filters/vars.lua | |||
@@ -1,4 +1,4 @@ | |||
1 | local common = require 'filters.lib.common' | 1 | local common = require 'scripts.lib.common' |
2 | 2 | ||
3 | local vars = {} | 3 | local vars = {} |
4 | 4 | ||