aboutsummaryrefslogtreecommitdiff
path: root/filters/syntax-highlighting.sh
diff options
from:
to:
context:
space:
mode:
authorGravatar Saya Andy <saya.andy@posteo.com> 2026-07-31 11:56:31 +0700
committerGravatar Saya Andy <saya.andy@posteo.com> 2026-07-31 11:56:31 +0700
commit793860dbd6df42d5bbf05542f2292a1c6d30fc76 (patch)
tree7f25119d300ea44371bd9d25207e1228cf488e0d /filters/syntax-highlighting.sh
parent306fafc1d1d19c51d7ac24479f49c76272934ce5 (diff)
downloadcgitext-793860dbd6df42d5bbf05542f2292a1c6d30fc76.tar.gz
cgitext-793860dbd6df42d5bbf05542f2292a1c6d30fc76.zip
style: replace hardcoded color codes with css variablesv1.3.1+10
In order to: a) do custom theme simpler by just replacing necessary vars, b) apply this theme to filters as well; the main cgit.css file now defines CSS vars and uses them in color parameters.
Diffstat (limited to 'filters/syntax-highlighting.sh')
-rwxr-xr-xfilters/syntax-highlighting.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
index 840bc34..bb8d60c 100755
--- a/filters/syntax-highlighting.sh
+++ b/filters/syntax-highlighting.sh
@@ -8,8 +8,10 @@
# might have to use an external call to sed instead.
#
# Note: the highlight command (http://www.andre-simon.de/) uses css for syntax
-# highlighting, so you'll probably want something like the following included
-# in your css file:
+# highlighting. cgit.css defines these classes in terms of its --syn-* custom
+# properties, so nothing has to be added when using the default stylesheet.
+# The palette below, from highlight 3.13, is what those properties default to;
+# a custom stylesheet wanting the same colors can use it directly:
#
# Style definition file generated by highlight 2.4.8, http://www.andre-simon.de/
#
@@ -114,8 +116,12 @@ EXTENSION="${BASENAME##*.}"
# Version 2 can be found (for example) on EPEL 5, while version 3 can be
# found (for example) on EPEL 6.
#
+# Note that -I (--include-style) is not used: the stylesheet it embeds in the
+# output would override the .hl rules in cgit.css and with them any theming
+# done through the --syn-* custom properties.
+#
# This is for version 2
-exec highlight --force -f -I -X -S "$EXTENSION" 2>/dev/null
+exec highlight --force -f -X -S "$EXTENSION" 2>/dev/null
# This is for version 3
-#exec highlight --force -f -I -O xhtml -S "$EXTENSION" 2>/dev/null
+#exec highlight --force -f -O xhtml -S "$EXTENSION" 2>/dev/null