Highlight code blocks with pygments #18

This commit is contained in:
Mathieu PATUREL
2017-02-11 08:52:42 +11:00
parent 40a563fb1e
commit 7257cb467e
8 changed files with 55 additions and 25 deletions

View File

@ -8,7 +8,7 @@ from collections import defaultdict
class Style:
# .highlight is the wrapper class for highlighting therefore
# all css rules are prefixed with .highlight
PREFIX = '.highlight'
PREFIX = '.codehilite'
# -----------------------------------------
# Params
@ -150,7 +150,7 @@ def pygments_from_theme(file):
styles.append(Style('bp', settings['variable.language'], settings['variable'], [settings['text_color']]))
styles.append(Style('p', [settings['text_color']]))
css = '.highlight { background-color: ' + settings['editor_bg'] + '; color: ' + settings['text_color'] + '; }\n'
css = '{} {{ background-color: {}; color: {}; }}\n'.format(Style.PREFIX, settings['editor_bg'], settings['text_color'])
for st in styles:
css_style = st.toString()
if css_style: