aboutsummaryrefslogtreecommitdiff
path: root/filters/syntax-highlighting.py
AgeCommit message (Collapse)Author
2026-07-31style: replace hardcoded color codes with css variablesv1.3.1+10Gravatar Saya Andy
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.
2018-01-19ui-blame: Allow syntax highlightingGravatar Jeff Smith
Place file contents into a single block so that syntax highlighting can be applied in the usual fashion. Place the alternating color bars behind the file contents. Force the default syntax highlighting background to transparent. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Reviewed-by: John Keeping <john@keeping.me.uk>
2017-01-22syntax-highlighting: replace invalid unicode with ?Gravatar Jason A. Donenfeld
2016-01-18syntax-highlighting: always use utf-8 to avoid ascii codec issuesGravatar Jason A. Donenfeld
2015-10-12filters: port syntax-highlighting.py to python 3.xGravatar Christian Hesse
Signed-off-by: Christian Hesse <mail@eworm.de>
2014-01-13filters: Improved syntax-highlighting.pyGravatar Stefan Tatschner
- Switched back to python2 according to a problem in pygments with python3. With the next release of pygments this problem should be fixed. Issue see here: https://bitbucket.org/birkenfeld/pygments-main/issue/901/problems-with-python3 - Just read the stdin, decode it to utf-8 and ignore unknown signs. This ensures that even destroyed files do not cause any errors in the filter. - Improved language guessing: -> At first use guess_lexer_for_filename for a better detection of the used programming languages (even mixed cases will be detected, e.g. php + html). -> If nothing was found look if there is a shebang and use guess_lexer. -> As default/fallback choose TextLexer. Signed-off-by: Stefan Tatschner <stefan@sevenbyte.org>
2014-01-08Fix UTF-8 with syntax-highlighting.pyGravatar Přemysl Janouch
Previously the script tried to encode output from Pygments with the ASCII codec, which failed. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com>
2013-05-27filters: import more modern scriptsGravatar Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>