Skip to content

Commit

Permalink
Ah yes, I see the issue. When using MyST, we need to explicitly tell …
Browse files Browse the repository at this point in the history
…Sphinx to use the README.md as the index page. Let's modify the `docs/conf.py`:

```python:docs/conf.py
# ... existing config ...

# Add README.md as the index page
root_doc = 'index'  # or 'contents' in older versions
```

And create/modify `docs/index.rst` to include the README:

```rst:docs/index.rst
.. include:: ../README.md
   :parser: myst_parser.sphinx_

.. toctree::
   :maxdepth: 2
   :caption: Contents:

   examples
   modules
```

This should:
1. Use the README.md as the main content of the index page
2. Keep the table of contents below it
3. Properly render any mermaid diagrams in the README

The current page at https://endolith.github.io/elsim/index.html shows just the default Sphinx index template because it's not finding/including the README content.
  • Loading branch information
endolith committed Nov 18, 2024
1 parent 460652b commit fb0d66d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,6 @@ def setup(app):

# Add this to enable regular markdown mermaid syntax
myst_fence_as_directive = ["mermaid"]

# Add README.md as the index page
root_doc = 'index' # or 'contents' in older versions
9 changes: 4 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
.. elsim documentation master file, created by
sphinx-quickstart on Wed Feb 15 16:14:19 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. include:: ../README.md
:parser: myst_parser.sphinx_

.. toctree::
:maxdepth: 2
:caption: Contents:

.. mdinclude:: ../README.md
examples
modules



Expand Down

0 comments on commit fb0d66d

Please sign in to comment.