summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-05-18 13:24:43 +0300
committerPaul Buetow <paul@buetow.org>2024-05-18 13:24:43 +0300
commit9aa92c98d3c886013750590abd2d8a07a48dc17e (patch)
tree7c94a3cdb40d47f4a195b77a5be499f274c2d438 /lib
parente132268eaf9348ecc421de63eeb9bcf522be70ee (diff)
add support for GNU Source Highlight CSS styles, e.g. to have a darker style.
Diffstat (limited to 'lib')
-rw-r--r--lib/html.source.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/html.source.sh b/lib/html.source.sh
index 50e6786..daa4224 100644
--- a/lib/html.source.sh
+++ b/lib/html.source.sh
@@ -130,7 +130,11 @@ html::source_highlight () {
html::encode "$bare_text"
echo '</pre>'
else
- $SOURCE_HIGHLIGHT --src-lang="$language" <<< "$bare_text" |
+ local style_css
+ if [ ! -z "$SOURCE_HIGHLIGHT_CSS" ]; then
+ style_css="--style-css-file=$SOURCE_HIGHLIGHT_CSS"
+ fi
+ $SOURCE_HIGHLIGHT --src-lang="$language" $style_css <<< "$bare_text" |
$SED 's|<tt>||; s|</tt>||;'
fi
}