recommonmark/README.md

60 lines
1.9 KiB
Markdown
Raw Normal View History

2014-10-17 22:29:41 +02:00
# recommonmark
2013-08-25 17:06:26 +02:00
2015-07-28 11:15:59 -07:00
A `docutils`-compatibility bridge to [CommonMark][cm].
This allows you to write CommonMark inside of Docutils & Sphinx projects.
2013-08-25 16:45:13 +02:00
2015-10-19 10:55:58 -07:00
Documentation is available on Read the Docs: <http://recommonmark.readthedocs.org>
## Getting Started
To use `recommonmark` inside of Sphinx only takes 2 steps.
First you install it:
pip install recommonmark
Then add this to your Sphinx conf.py:
from recommonmark.parser import CommonMarkParser
source_parsers = {
'.md': CommonMarkParser,
}
source_suffix = ['.rst', '.md']
2015-08-23 15:19:28 -07:00
2014-10-17 22:29:41 +02:00
## Why a bridge?
2013-08-25 16:45:13 +02:00
2014-10-17 22:29:41 +02:00
Many python tools (mostly for documentation creation) rely on `docutils`.
But [docutils][dc] only supports a ReStructuredText syntax.
2013-08-25 16:45:13 +02:00
2014-10-17 22:29:41 +02:00
For instance [this issue][sphinx-issue] and [this StackOverflow
question][so-question] show that there is an interest in allowing `docutils`
to use markdown as an alternative syntax.
2013-08-25 16:45:13 +02:00
2014-10-17 22:29:41 +02:00
## Why another bridge to docutils?
2013-08-25 16:45:13 +02:00
2014-10-17 22:29:41 +02:00
recommonmark uses the [python implementation][pcm] of [CommonMark][cm] while
[remarkdown][rmd] implements a stand-alone parser leveraging [parsley][prs].
2013-08-25 16:45:13 +02:00
2014-10-17 22:29:41 +02:00
Both output a [`docutils` document tree][dc] and provide scripts
that leverage `docutils` for generation of different types of documents.
2013-08-25 16:45:13 +02:00
2014-10-17 22:29:41 +02:00
## Acknowledgement
2013-08-25 16:45:13 +02:00
2014-10-17 22:29:41 +02:00
recommonmark is mainly derived from [remarkdown][rmd] by Steve Genoud and
leverages the python CommonMark implementation.
2013-08-25 16:45:13 +02:00
2015-07-28 11:12:27 -07:00
It was originally created by [Luca Barbato][lu-zero],
and is now maintained in the Read the Docs (rtfd) GitHub organization.
2015-07-28 10:44:19 -07:00
2014-10-17 22:29:41 +02:00
[cm]: http://commonmark.org
[pcm]: https://github.com/rolandshoemaker/CommonMark-py
[rmd]: https://github.com/sgenoud/remarkdown
[prs]: https://github.com/python-parsley/parsley
2015-07-28 10:44:19 -07:00
[lu-zero]: https://github.com/lu-zero
2013-08-25 16:45:13 +02:00
2014-10-17 22:29:41 +02:00
[dc]: http://docutils.sourceforge.net/docs/ref/doctree.html
[sphinx-issue]: https://bitbucket.org/birkenfeld/sphinx/issue/825/markdown-capable-sphinx
[so-question]: http://stackoverflow.com/questions/2471804/using-sphinx-with-markdown-instead-of-rst