sphinx/doc/usage/markdown.rst

48 lines
1.4 KiB
ReStructuredText
Raw Normal View History

.. highlight:: python
2017-01-29 03:58:22 -06:00
.. _markdown:
========
Markdown
========
2017-01-29 03:58:22 -06:00
`Markdown`__ is a lightweight markup language with a simplistic plain text
formatting syntax. It exists in many syntactically different *flavors*. To
support Markdown-based documentation, Sphinx can use `recommonmark`__.
recommonmark is a Docutils bridge to `CommonMark-py`__, a Python package for
parsing the `CommonMark`__ Markdown flavor.
__ https://daringfireball.net/projects/markdown/
__ https://recommonmark.readthedocs.io/en/latest/index.html
__ https://github.com/rtfd/CommonMark-py
__ http://commonmark.org/
2017-01-29 03:58:22 -06:00
Configuration
-------------
To configure your Sphinx project for Markdown support, proceed as follows:
2017-01-29 03:58:22 -06:00
#. Install *recommonmark*::
2017-01-29 03:58:22 -06:00
pip install recommonmark
2017-01-29 03:58:22 -06:00
#. Add the Markdown parser to the ``source_parsers`` configuration variable in
your Sphinx configuration file::
2017-01-29 03:58:22 -06:00
source_parsers = {
'.md': 'recommonmark.parser.CommonMarkParser',
}
You can replace ``.md`` with a filename extension of your choice.
2017-01-29 03:58:22 -06:00
#. Add the Markdown filename extension to the ``source_suffix`` configuration
variable::
2017-01-29 03:58:22 -06:00
source_suffix = ['.rst', '.md']
#. You can further configure *recommonmark* to allow custom syntax that
standard *CommonMark* doesn't support. Read more in the `recommonmark
documentation`__.
__ https://recommonmark.readthedocs.io/en/latest/auto_structify.html