mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
revert #523
we don't need a new MARKDOWN_EXTENSIONS setting because the equivalent setting MD_EXTENSIONS already exists.
This commit is contained in:
parent
6236e8f66b
commit
8bb86d3e5d
5 changed files with 4 additions and 15 deletions
|
|
@ -163,6 +163,3 @@ SITEURL :
|
||||||
|
|
||||||
STATIC_PATHS :
|
STATIC_PATHS :
|
||||||
Les chemins statiques que vous voulez avoir accès sur le chemin de sortie "statique" ;
|
Les chemins statiques que vous voulez avoir accès sur le chemin de sortie "statique" ;
|
||||||
|
|
||||||
MARKDOWN_EXTENSIONS :
|
|
||||||
Liste des extentions Markdown que vous souhaitez utiliser ;
|
|
||||||
|
|
|
||||||
|
|
@ -129,8 +129,6 @@ Setting name (default value) What doe
|
||||||
Can be used to separate templates from the theme.
|
Can be used to separate templates from the theme.
|
||||||
Example: projects, resume, profile ...
|
Example: projects, resume, profile ...
|
||||||
This templates need to use ``DIRECT_TEMPLATES`` setting
|
This templates need to use ``DIRECT_TEMPLATES`` setting
|
||||||
|
|
||||||
`MARKDOWN_EXTENSIONS` (``['toc',]``) A list of any Markdown extensions you want to use.
|
|
||||||
`ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to asciidoc, see the `manpage
|
`ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to asciidoc, see the `manpage
|
||||||
<http://www.methods.co.nz/asciidoc/manpage.html>`_
|
<http://www.methods.co.nz/asciidoc/manpage.html>`_
|
||||||
===================================================================== =====================================================================
|
===================================================================== =====================================================================
|
||||||
|
|
|
||||||
|
|
@ -136,13 +136,8 @@ class MarkdownReader(Reader):
|
||||||
|
|
||||||
def read(self, filename):
|
def read(self, filename):
|
||||||
"""Parse content and metadata of markdown files"""
|
"""Parse content and metadata of markdown files"""
|
||||||
markdown_extensions = self.settings.get('MARKDOWN_EXTENSIONS', [])
|
|
||||||
if isinstance(markdown_extensions, (str, unicode)):
|
|
||||||
markdown_extensions = [m.strip() for m in
|
|
||||||
markdown_extensions.split(',')]
|
|
||||||
text = pelican_open(filename)
|
text = pelican_open(filename)
|
||||||
md = Markdown(extensions=set(
|
md = Markdown(extensions=set(self.extensions + ['meta']))
|
||||||
self.extensions + markdown_extensions + ['meta']))
|
|
||||||
content = md.convert(text)
|
content = md.convert(text)
|
||||||
|
|
||||||
metadata = {}
|
metadata = {}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@ _DEFAULT_CONFIG = {'PATH': '.',
|
||||||
'TYPOGRIFY': False,
|
'TYPOGRIFY': False,
|
||||||
'SUMMARY_MAX_LENGTH': 50,
|
'SUMMARY_MAX_LENGTH': 50,
|
||||||
'PLUGINS': [],
|
'PLUGINS': [],
|
||||||
'MARKDOWN_EXTENSIONS': ['toc', ],
|
|
||||||
'TEMPLATE_PAGES': {}
|
'TEMPLATE_PAGES': {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -145,9 +145,9 @@ class MdReaderTest(unittest.TestCase):
|
||||||
@unittest.skipUnless(readers.Markdown, "markdown isn't installed")
|
@unittest.skipUnless(readers.Markdown, "markdown isn't installed")
|
||||||
def test_article_with_markdown_markup_extension(self):
|
def test_article_with_markdown_markup_extension(self):
|
||||||
# test to ensure the markdown markup extension is being processed as expected
|
# test to ensure the markdown markup extension is being processed as expected
|
||||||
reader = readers.MarkdownReader({})
|
content, metadata = readers.read_file(
|
||||||
reader.settings.update(dict(MARKDOWN_EXTENSIONS=['toc', ]))
|
_filename('article_with_markdown_markup_extensions.md'),
|
||||||
content, metadata = reader.read(_filename('article_with_markdown_markup_extensions.md'))
|
settings={'MD_EXTENSIONS': ['toc', 'codehilite', 'extra']})
|
||||||
expected = '<div class="toc">\n'\
|
expected = '<div class="toc">\n'\
|
||||||
'<ul>\n'\
|
'<ul>\n'\
|
||||||
'<li><a href="#level1">Level1</a><ul>\n'\
|
'<li><a href="#level1">Level1</a><ul>\n'\
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue