diff options
author | Volpeon <git@volpeon.ink> | 2021-01-07 20:48:05 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2021-01-07 20:48:05 +0100 |
commit | f3e649f674b739a8f50460f809eb8df2c13ff576 (patch) | |
tree | a406fc9a1c4d539e250f9869e6c93e5398f733d6 /filters | |
parent | Small design adjustments, added support for code blocks marked as 'plain' (diff) | |
download | volpeon.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.lua | 4 |
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 |