Support for pygment defaults and relevant documentation

This commit is contained in:
SDGSDG 2013-09-15 22:43:24 -07:00
commit 3580233b38
21 changed files with 288 additions and 33 deletions

View file

@ -107,12 +107,15 @@ DEFAULT_CONFIG = {
'SUMMARY_MAX_LENGTH': 50,
'PLUGIN_PATH': '',
'PLUGINS': [],
'PYGMENTS_RST_OPTIONS': {},
'TEMPLATE_PAGES': {},
'IGNORE_FILES': ['.#*'],
'SLUG_SUBSTITUTIONS': (),
'INTRASITE_LINK_REGEX': '[{|](?P<what>.*?)[|}]',
}
PYGMENTS_RST_OPTIONS = None
def read_settings(path=None, override=None):
if path:
@ -131,7 +134,14 @@ def read_settings(path=None, override=None):
if override:
local_settings.update(override)
return configure_settings(local_settings)
parsed_settings = configure_settings(local_settings)
# This is because there doesn't seem to be a way to pass extra
# parameters to docutils directive handlers, so we have to have a
# variable here that we'll import from within Pygments.run (see
# rstdirectives.py) to see what the user defaults were.
global PYGMENTS_RST_OPTIONS
PYGMENTS_RST_OPTIONS = parsed_settings.get('PYGMENTS_RST_OPTIONS', None)
return parsed_settings
def get_settings_from_module(module=None, default_settings=DEFAULT_CONFIG):