diff options
| author | Paul Buetow <paul@buetow.org> | 2024-05-18 13:24:43 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-05-18 13:24:43 +0300 |
| commit | 9aa92c98d3c886013750590abd2d8a07a48dc17e (patch) | |
| tree | 7c94a3cdb40d47f4a195b77a5be499f274c2d438 /lib | |
| parent | e132268eaf9348ecc421de63eeb9bcf522be70ee (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.sh | 6 |
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 } |
