Tweak the default code highlighting theme

This commit is contained in:
Thomas Sileo 2022-07-12 19:50:11 +02:00
parent 6ce42e019e
commit 5845bb72f5
2 changed files with 6 additions and 1 deletions

View file

@ -93,6 +93,9 @@ EMOJI_TPL = '<img src="/static/twemoji/{filename}.svg" alt="{raw}" class="emoji"
_load_emojis(ROOT_DIR, BASE_URL) _load_emojis(ROOT_DIR, BASE_URL)
# TODO(ts): allow to override this
CODE_HIGHLIGHTING_THEME = "friendly_grayscale"
session_serializer = URLSafeTimedSerializer( session_serializer = URLSafeTimedSerializer(
CONFIG.secret, CONFIG.secret,

View file

@ -5,7 +5,9 @@ from pygments import highlight as phighlight # type: ignore
from pygments.formatters import HtmlFormatter # type: ignore from pygments.formatters import HtmlFormatter # type: ignore
from pygments.lexers import guess_lexer # type: ignore from pygments.lexers import guess_lexer # type: ignore
_FORMATTER = HtmlFormatter(style="vim") from app.config import CODE_HIGHLIGHTING_THEME
_FORMATTER = HtmlFormatter(style=CODE_HIGHLIGHTING_THEME)
HIGHLIGHT_CSS = _FORMATTER.get_style_defs() HIGHLIGHT_CSS = _FORMATTER.get_style_defs()