diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 350cfb69..0c1448fb 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -232,10 +232,11 @@ Pelican implements an extension to reStructuredText to enable support for the This will be turned into :abbr:`HTML (HyperText Markup Language)`. -You can also use Markdown syntax (with a file ending in ``.md``, ``.markdown``, -or ``.mkd``). Markdown generation requires that you first explicitly install -the ``Markdown`` package, which can be done via ``pip install Markdown``. -Metadata syntax for Markdown posts should follow this pattern:: +You can also use Markdown syntax (with a file ending in ``.md``, +``.markdown``, ``.mkd``, or ``.mdown``). Markdown generation requires that you +first explicitly install the ``Markdown`` package, which can be done via ``pip +install Markdown``. Metadata syntax for Markdown posts should follow this +pattern:: Title: My super title Date: 2010-12-03 10:20 diff --git a/docs/settings.rst b/docs/settings.rst index e11b5a1d..0212fd24 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -80,7 +80,7 @@ Setting name (default value) What doe until one works. `MARKUP` (``('rst', 'md')``) A list of available markup languages you want to use. For the moment, the only available values - are `rst`, `md`, `markdown`, `mkd`, `html`, and `htm`. + are `rst`, `md`, `markdown`, `mkd`, `mdown`, `html`, and `htm`. `IGNORE_FILES` (``[]``) A list of file globbing patterns to match against the source files to be ignored by the processor. For example ``['.#*']`` will ignore emacs temporary files. diff --git a/pelican/readers.py b/pelican/readers.py index d075a039..797994cb 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -149,7 +149,7 @@ class RstReader(Reader): class MarkdownReader(Reader): enabled = bool(Markdown) - file_extensions = ['md', 'markdown', 'mkd'] + file_extensions = ['md', 'markdown', 'mkd', 'mdown'] default_extensions = ['codehilite(css_class=highlight)', 'extra'] def __init__(self, *args, **kwargs): diff --git a/pelican/tests/content/article_with_mdown_extension.mdown b/pelican/tests/content/article_with_mdown_extension.mdown new file mode 100644 index 00000000..bdaf74cd --- /dev/null +++ b/pelican/tests/content/article_with_mdown_extension.mdown @@ -0,0 +1,10 @@ +title: Test mdown File +category: test + +Test Markdown File Header +========================= + +Used for pelican test +--------------------- + +This is another markdown test file. Uses the mdown extension. diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 49fe0c81..5381a776 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -172,6 +172,14 @@ class MdReaderTest(unittest.TestCase): " test\n

This is another markdown test file. Uses" " the markdown extension.

") self.assertEqual(content, expected) + # test to ensure the mdown file extension is being processed by the + # correct reader + content, metadata = reader.read( + _path('article_with_mdown_extension.mdown')) + expected = ("

Test Markdown File Header

\n

Used for pelican" + " test

\n

This is another markdown test file. Uses" + " the mdown extension.

") + self.assertEqual(content, expected) @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_markdown_markup_extension(self):