comparison piecrust/templating/jinjaengine.py @ 506:6ca1b6fb9964

templating: `highlight_css` can be passed the name of a Pygments style.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 25 Jul 2015 21:55:26 -0700
parents 61508ae67488
children 4bca25f99463
comparison
equal deleted inserted replaced
505:883a5544cd7f 506:6ca1b6fb9964
401 401
402 code = highlight(Markup(body.rstrip()).unescape(), lexer, formatter) 402 code = highlight(Markup(body.rstrip()).unescape(), lexer, formatter)
403 return code 403 return code
404 404
405 405
406 def get_highlight_css(class_name='.highlight'): 406 def get_highlight_css(style_name='default', class_name='.highlight'):
407 return HtmlFormatter().get_style_defs(class_name) 407 return HtmlFormatter(style=style_name).get_style_defs(class_name)
408 408
409 409
410 class PieCrustCacheExtension(Extension): 410 class PieCrustCacheExtension(Extension):
411 tags = set(['pccache', 'cache']) 411 tags = set(['pccache', 'cache'])
412 412