I am documenting a Python 3 project with Sphinx. The Sphinx docs are in doc
, and I would like to include the contents of my top level README.md
in my index. Assume that I can get Sphinx to parse and render Markdown using the instructions in issue #825.
If my doc/index.rst
looks like this:
Index
=====
Modules
-------
.. toctree::
:maxdepth: 2
.. include:: ../README.md
...the markdown is parsed as reStructuredText (because that's how the include
directive works). This means that most of the markdown formatting is ignored.
Even a link won't work: it's not possible to directly create a link to a document above doc/
, and any workaround still requires including a markdown document within reST. In any case, what I really want is the content rendered in the index.
Is it possible to somehow tell Sphinx that one part of a document is in a different markup language than the rest, or to change parsing contexts for a section of a document? Or is there some other way to tell it to inject one document into another after the parsing has been done?