summaryrefslogtreecommitdiffstats
path: root/filters/common_actions.lua
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-01-07 08:50:48 +0100
committerVolpeon <git@volpeon.ink>2021-01-07 08:50:48 +0100
commitad478954cf77842364d03e1d5ee85e366e699ee7 (patch)
tree90359dfec83694a758878b37510d9dca1493ef43 /filters/common_actions.lua
parentImproved subpage organization code in metadata filter (diff)
downloadvolpeon.ink-ad478954cf77842364d03e1d5ee85e366e699ee7.tar.gz
volpeon.ink-ad478954cf77842364d03e1d5ee85e366e699ee7.tar.bz2
volpeon.ink-ad478954cf77842364d03e1d5ee85e366e699ee7.zip
Improved general structure, resolve category name in metadata filter, added hideable nav items, added header for page layout
Diffstat (limited to 'filters/common_actions.lua')
-rw-r--r--filters/common_actions.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/filters/common_actions.lua b/filters/common_actions.lua
index 1d13e3a..a358b99 100644
--- a/filters/common_actions.lua
+++ b/filters/common_actions.lua
@@ -2,7 +2,10 @@ function CodeBlock(el)
2 if next(el.classes) == nil then 2 if next(el.classes) == nil then
3 el.classes = el.classes .. {'c-page__prefixed', 'c-page__prefixed--pre'} 3 el.classes = el.classes .. {'c-page__prefixed', 'c-page__prefixed--pre'}
4 else 4 else
5 local formatted = pandoc.pipe('pygmentize', {'-l', el.classes[1], '-f', 'html', '-O', 'cssclass=c-page__code s-code'}, el.text) 5 local formatted = pandoc.pipe('pygmentize', {
6 '-l', el.classes[1], '-f', 'html', '-O',
7 'cssclass=c-page__code s-code'
8 }, el.text)
6 el = pandoc.RawBlock('html', formatted) 9 el = pandoc.RawBlock('html', formatted)
7 end 10 end
8 11
@@ -21,9 +24,7 @@ function Header(el)
21end 24end
22 25
23function Div(el) 26function Div(el)
24 if el.attributes.macro == nil then 27 if el.attributes.macro == nil then return el end
25 return el
26 end
27 28
28 if el.attributes.macro == 'refs' and el.content[1].tag == 'BulletList' then 29 if el.attributes.macro == 'refs' and el.content[1].tag == 'BulletList' then
29 local newchildren = pandoc.List() 30 local newchildren = pandoc.List()
@@ -31,7 +32,8 @@ function Div(el)
31 newchildren:insert(pandoc.RawBlock('html', '<ul>')) 32 newchildren:insert(pandoc.RawBlock('html', '<ul>'))
32 33
33 for k, children in ipairs(el.content[1].content) do 34 for k, children in ipairs(el.content[1].content) do
34 newchildren:insert(pandoc.RawBlock('html', '<li class="c-page__prefixed c-page__prefixed--ref">')) 35 newchildren:insert(pandoc.RawBlock('html',
36 '<li class="c-page__prefixed c-page__prefixed--ref">'))
35 newchildren:extend(children) 37 newchildren:extend(children)
36 newchildren:insert(pandoc.RawBlock('html', '</li>')) 38 newchildren:insert(pandoc.RawBlock('html', '</li>'))
37 end 39 end