From 62a059c822fa3ddf9a5ae771fe1496bdf82f32c5 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 19 Jul 2026 16:40:16 -1000 Subject: Move syntax highlighting to a Lua source filter --- cgitrc.5.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cgitrc.5.txt') diff --git a/cgitrc.5.txt b/cgitrc.5.txt index e56cbae..a456ddf 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -474,9 +474,10 @@ source-filter:: and the name of the blob as its only command line argument. The STDOUT from the command will be included verbatim as the blob contents, i.e. this can be used to implement e.g. syntax highlighting. When no - source-filter is configured, cgit highlights common languages in the - browser with the bundled cgit.js, so a filter is only needed to - override that. Default value: none. See also: "FILTER API". + source-filter is configured, cgit serves the text plain. A ready + syntax highlighter using the Scintillua lexer collection ships as + extensions/syntax-highlight.lua, see the comments in that file for + its dependencies. Default value: none. See also: "FILTER API". summary-branches:: Specifies the number of branches to display in the repository "summary" @@ -951,8 +952,9 @@ mimetype.png=image/png mimetype.svg=image/svg+xml -# Source code is highlighted in the browser by the bundled cgit.js, so no -# source-filter is needed here. Set one only to override that. +# Source code is served plain unless a source-filter is set. The shipped +# extensions/syntax-highlight.lua highlights through the Scintillua lexers. +# source-filter=lua:/usr/share/cgit/extensions/syntax-highlight.lua # Markdown about pages render client-side by default (see enable-markdown). # For other formats such as manpages, point about-filter at your own script. -- cgit v2.8.0