[PATCH] Updated syntax highlighting for highlight 3.6

Lauri Niskanen ape at ape3000.com
Sat Nov 5 00:02:58 CET 2011


Hello!

The syntax highlighting filter in cgit doesn't work properly with the 
latest version of highlight. Some CSS class names have changed and there 
is no option -X. This patch fixes these issues.

 From 50574f349b369bbd26b07f0a186c1476b9a9ecca Mon Sep 17 00:00:00 2001
From: Lauri Niskanen <ape at ape3000.com>
Date: Sat, 5 Nov 2011 00:57:48 +0200
Subject: [PATCH] Updated syntax highlighting for highlight 3.6

---
  cgit.css                       |    7 ++++---
  filters/syntax-highlighting.sh |    9 +++++----
  2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/cgit.css b/cgit.css
index 55afa94..253b495 100644
--- a/cgit.css
+++ b/cgit.css
@@ -793,11 +793,12 @@ table.ssdiff td.space div {
  table.blob .num  { color:#2928ff; }
  table.blob .esc  { color:#ff00ff; }
  table.blob .str  { color:#ff0000; }
-table.blob .dstr { color:#818100; }
+table.blob .pps  { color:#818100; }
  table.blob .slc  { color:#838183; font-style:italic; }
  table.blob .com  { color:#838183; font-style:italic; }
-table.blob .dir  { color:#008200; }
-table.blob .sym  { color:#000000; }
+table.blob .ppc  { color:#008200; }
+table.blob .opt  { color:#000000; }
+table.blob .lin  { color:#555555; }
  table.blob .kwa  { color:#000000; font-weight:bold; }
  table.blob .kwb  { color:#830000; }
  table.blob .kwc  { color:#000000; font-weight:bold; }
diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh
index 6283ce9..e592a66 100755
--- a/filters/syntax-highlighting.sh
+++ b/filters/syntax-highlighting.sh
@@ -14,11 +14,12 @@
  # table.blob .num  { color:#2928ff; }
  # table.blob .esc  { color:#ff00ff; }
  # table.blob .str  { color:#ff0000; }
-# table.blob .dstr { color:#818100; }
+# table.blob .pps  { color:#818100; }
  # table.blob .slc  { color:#838183; font-style:italic; }
  # table.blob .com  { color:#838183; font-style:italic; }
-# table.blob .dir  { color:#008200; }
-# table.blob .sym  { color:#000000; }
+# table.blob .ppc  { color:#008200; }
+# table.blob .opt  { color:#000000; }
+# table.blob .lin  { color:#555555; }
  # table.blob .kwa  { color:#000000; font-weight:bold; }
  # table.blob .kwb  { color:#830000; }
  # table.blob .kwc  { color:#000000; font-weight:bold; }
@@ -42,4 +43,4 @@ EXTENSION="${BASENAME##*.}"
  # map Makefile and Makefile.* to .mk
  [ "${BASENAME%%.*}" == "Makefile" ] && EXTENSION=mk

-exec highlight --force -f -I -X -S $EXTENSION 2>/dev/null
+exec highlight --force -f -I -S $EXTENSION 2>/dev/null
-- 
1.7.7.2

-- 
Ape <Lauri Niskanen>




More information about the CGit mailing list