Commit Graph

8 Commits (8ed1bef90f631989c0cadc326a163b874a64e02d)

Author SHA1 Message Date
Samuel Lidén Borell 8ed1bef90f css: Support for dark mode
Modern browsers have a "dark mode" preference, which enables alternate
styles on web sites that support this.

This patch adds a dark color scheme, that is automatically activated
via a CSS @media query.

Older browsers that do not support color schemes will simply show the
light scheme, but possibly without syntax highlighting.

Note that filters that use color (such as source highlighters) and
logotypes may need to be updated to work with a black background!
See the updated files in the filters/ directory.

Signed-off-by: Samuel Lidén Borell <samuel@kodafritt.se>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
1 year ago
Jeff Smith dbaee2672b ui-blame: Allow syntax highlighting
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>
6 years ago
Jason A. Donenfeld 5564a5d066 syntax-highlighting: replace invalid unicode with ? 7 years ago
Jason A. Donenfeld d3756bd7b0 syntax-highlighting: always use utf-8 to avoid ascii codec issues 9 years ago
Christian Hesse 143e65252c filters: port syntax-highlighting.py to python 3.x
Signed-off-by: Christian Hesse <mail@eworm.de>
9 years ago
Stefan Tatschner ceffeb5d52 filters: Improved syntax-highlighting.py
- 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>
11 years ago
Přemysl Janouch b6da53dd75 Fix UTF-8 with syntax-highlighting.py
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>
11 years ago
Jason A. Donenfeld 8149be213f filters: import more modern scripts
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
11 years ago