1
0
Fork 0
forked from github/pelican

Replaces MD_EXTENSIONS with MARKDOWN

MARKDOWN allows to configure the python markdown module

fixes #1024
This commit is contained in:
Bernhard Scheirle 2016-03-14 20:37:27 +01:00
commit 35dba138e0
2 changed files with 22 additions and 15 deletions

View file

@ -101,10 +101,12 @@ DEFAULT_CONFIG = {
'PELICAN_CLASS': 'pelican.Pelican',
'DEFAULT_DATE_FORMAT': '%a %d %B %Y',
'DATE_FORMATS': {},
'MD_EXTENSIONS': {
'markdown.extensions.codehilite': {'css_class': 'highlight'},
'markdown.extensions.extra': {},
'markdown.extensions.meta': {},
'MARKDOWN': {
'extension_configs': {
'markdown.extensions.codehilite': {'css_class': 'highlight'},
'markdown.extensions.extra': {},
'markdown.extensions.meta': {},
},
},
'JINJA_EXTENSIONS': [],
'JINJA_FILTERS': {},
@ -368,13 +370,11 @@ def configure_settings(settings):
PATH_KEY)
settings[PATH_KEY] = DEFAULT_CONFIG[PATH_KEY]
# Save people from declaring MD_EXTENSIONS as a list rather than a dict
if not isinstance(settings.get('MD_EXTENSIONS', {}), dict):
logger.warning('The format of the MD_EXTENSIONS setting has '
'changed. It should now be a dict mapping '
'fully-qualified extension names to their '
'configurations. Falling back to the default.')
settings['MD_EXTENSIONS'] = DEFAULT_CONFIG['MD_EXTENSIONS']
# Deprecated warning of MD_EXTENSIONS
if 'MD_EXTENSIONS' in settings:
logger.warning('MD_EXTENSIONS is deprecated use MARKDOWN '
'instead. Falling back to the default.')
settings['MARKDOWN'] = DEFAULT_CONFIG['MARKDOWN']
# Add {PAGE,ARTICLE}_PATHS to {ARTICLE,PAGE}_EXCLUDES
mutually_exclusive = ('ARTICLE', 'PAGE')