Hatta Numbered Lists Branch

changeset 742:d6e380970ba0

Make pygment style configurable
author Ben
date Mon Jan 04 19:03:31 2010 +0100 (2010-01-04)
parents 7a31aaea2d2f
children
files hatta.py
line diff
     1.1 --- a/hatta.py	Thu Dec 24 22:30:04 2009 +0100
     1.2 +++ b/hatta.py	Mon Jan 04 19:03:31 2010 +0100
     1.3 @@ -2019,8 +2019,9 @@
     1.4              yield werkzeug.html.pre(werkzeug.html(text))
     1.5              return
     1.6  
     1.7 -        if 'tango' in pygments.styles.STYLE_MAP:
     1.8 -            style = 'tango'
     1.9 +        configstyle = self.config.get('pygment_style', 'tango')
    1.10 +        if configstyle in pygments.styles.STYLE_MAP:
    1.11 +            style = configstyle
    1.12          else:
    1.13              style = 'friendly'
    1.14          formatter = pygments.formatters.HtmlFormatter(style=style)
    1.15 @@ -2439,8 +2440,9 @@
    1.16              sys.stdout.write("Hatta %s\n" % __version__)
    1.17              sys.exit()
    1.18          if pygments is not None:
    1.19 -            if 'tango' in pygments.styles.STYLE_MAP:
    1.20 -                style = 'tango'
    1.21 +            configstyle = config.get('pygment_style','tango')
    1.22 +            if configstyle in pygments.styles.STYLE_MAP:
    1.23 +                style = configstyle
    1.24              else:
    1.25                  style = 'friendly'
    1.26              formatter = pygments.formatters.HtmlFormatter(style=style)