summaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-01-07 20:48:05 +0100
committerVolpeon <git@volpeon.ink>2021-01-07 20:48:05 +0100
commitf3e649f674b739a8f50460f809eb8df2c13ff576 (patch)
treea406fc9a1c4d539e250f9869e6c93e5398f733d6 /filters
parentSmall design adjustments, added support for code blocks marked as 'plain' (diff)
downloadvolpeon.ink-f3e649f674b739a8f50460f809eb8df2c13ff576.tar.gz
volpeon.ink-f3e649f674b739a8f50460f809eb8df2c13ff576.tar.bz2
volpeon.ink-f3e649f674b739a8f50460f809eb8df2c13ff576.zip
Optimized CSS for code blocks
Diffstat (limited to 'filters')
-rw-r--r--filters/common_actions.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/filters/common_actions.lua b/filters/common_actions.lua
index abb15a1..9ebcf17 100644
--- a/filters/common_actions.lua
+++ b/filters/common_actions.lua
@@ -2,11 +2,11 @@ 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 elseif el.classes[1] == "plain" then 4 elseif el.classes[1] == "plain" then
5 el = pandoc.Div({el}, {class = 'c-page__code s-code s-code--plain'}) 5 el = pandoc.Div({el}, {class = 's-code'})
6 else 6 else
7 local formatted = pandoc.pipe('pygmentize', { 7 local formatted = pandoc.pipe('pygmentize', {
8 '-l', el.classes[1], '-f', 'html', '-O', 8 '-l', el.classes[1], '-f', 'html', '-O',
9 'cssclass=c-page__code s-code' 9 'cssclass=s-code s-code--highlight'
10 }, el.text) 10 }, el.text)
11 el = pandoc.RawBlock('html', formatted) 11 el = pandoc.RawBlock('html', formatted)
12 end 12 end