Open jedbrown opened 3 years ago
I know this issue is kind of old but did anyone find a good solution for this?
I have the exact same situation that examples live in my project root. Here, I use jupytext to keep myst/.ipynb/.py files in sync. I would love to simply include
them in the main toctree..
I sense that I cannot nest one MyST directive inside another like:
```{toctree} :maxdepth: 2 :caption: Contents
```{include} ../README.md ``` ```
Is there an alternate syntax that would allow importing the parent directory's README.md
into the toctree
?
Can someone please show me how I can change: https://myst-parser.readthedocs.io/en/latest/syntax/organising_content.html#using-toctree-to-include-other-documents-as-children to include
../content_child1.md
instead of examples/content_child1.md
and../content_child2.md
instead of examples/content_child2.md
?@chrisjsewell
Is your feature request related to a problem? Please describe.
We've been keeping general documentation under
doc/sphinx/
while keeping example documentation alongside the examples, as inexamples/fluids/index.md
. These files contain a sort of theory manual as well as information on running and extending the examples.Common advice prior to MyST has been to have some code in
conf.py
that copies such files intodoc/sphinx/examples/fluids/index.md
, but this just feels dirty and also causes "Edit this page" links to 404. I was hoping that the MyST includes feature (https://myst-parser.readthedocs.io/en/latest/sphinx/use.html#include-a-file-from-outside-the-docs-folder-like-readme-md) could be used for this, but it appears not.Describe the solution you'd like
I would love to be able to include
../../examples/index.md
and then use relative paths within the tree, keepingconf.py
under adocs/
subdirectory.Describe alternatives you've considered
doc/sphinx/examples/
.conf.py
to the top level and make needed adjustments toexclude_patterns
.In retrospect, I think 3 would have saved significant time over the years, it's just disappointing to require a non-namespaced file at the top level. If that's the pragmatic solution, feel free to close this.