From d4940d531ba0bdffbfb95e5c0d299956bd3e4e6c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 16 Sep 2026 14:45:54 +0200 Subject: filters: add syntax-highlighting.js Move to using client-side highlighting, combining pygment's filetype detection with highlight.js's actual highlighting logic. Use pygment's pastie, but also bring in a generated dark version of it. Signed-off-by: Jason A. Donenfeld --- filters/syntax-highlighting.js/README | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 filters/syntax-highlighting.js/README (limited to 'filters/syntax-highlighting.js/README') diff --git a/filters/syntax-highlighting.js/README b/filters/syntax-highlighting.js/README new file mode 100644 index 0000000..9ea3a7f --- /dev/null +++ b/filters/syntax-highlighting.js/README @@ -0,0 +1,14 @@ +Serve this directory at /syntax-highlighting.js/ (by symlinking it from +filters/, for example) and configure cgit: + + js=/cgit.js + js=/syntax-highlighting.js/loader.js + +Remove source-filter and repo.source-filter settings. Styles and language +modules load automatically from the same directory as loader.js. +Pastie and Pastie Dark follow the browser's color preference. + +To generate the required files, install Python 3, Pygments, and Node.js, +then run from this directory: + + ./generate.py -- cgit v1.2.3