Skip to content

Migrate documentation to MkDocs Material (like MyoGestic) #18

@RaulSimpetru

Description

@RaulSimpetru

Summary

Move MyoGen's documentation off the current Sphinx stack and onto the same modern MkDocs-based setup that MyoGestic already uses. The MyoGestic docs are cleaner, easier to author (plain Markdown), and follow a clear Diátaxis structure.

Current state

MyoGen docs are built with Sphinx:

  • pydata-sphinx-theme, sphinx-gallery, sphinx-design, sphinx-hoverxref, sphinx-autodoc-typehints, sphinxcontrib-mermaid, enum-tools[sphinx]
  • reStructuredText + MyST mix under docs/source/ (conf.py, index.md, examples.rst, neo_blocks_guide.rst, api/, auto_examples/, …)
  • deployed via .github/workflows/sphinx.yml

Target (MyoGestic's stack)

properdocs
mkdocs-material >= 9.5
mkdocstrings[python] >= 0.27
mkdocs-section-index >= 0.3

MyoGestic's docs/ is organised roughly as:

getting-started.md
concepts/         (explanation)
how-to/           (task guides)
tutorials/
reference/        (incl. api/ via mkdocstrings)
troubleshooting.md
anatomy.md
index.md

…and deploys to GitHub Pages through an actions/upload-pages-artifact workflow (docs.yml).

Why

  • Markdown-first authoring (no rST), much lower friction for contributors.
  • MkDocs Material gives search, nav, dark mode, admonitions, code annotations out of the box.
  • mkdocstrings pulls API docs straight from docstrings/type hints — comparable to autodoc but simpler config.
  • Consistency with MyoGestic so the two NsquaredLab projects share one docs toolchain and look.

Scope / tasks

  • Add the MkDocs docs dependency group (properdocs, mkdocs-material, mkdocstrings[python], mkdocs-section-index) and an mkdocs.yml.
  • Port existing content to Markdown under a Diátaxis layout (getting-started / concepts / how-to / tutorials / reference).
  • Replace sphinx-gallery example generation — decide how the examples/ scripts surface in MkDocs (e.g. mkdocs-gallery, executed notebooks, or rendered source + outputs).
  • Migrate the API reference from autodoc to mkdocstrings (::: symbol pages).
  • Swap the deploy workflow from sphinx.yml to a MkDocs Pages build.
  • Remove the now-unused Sphinx dependencies and docs/source/ rST scaffolding once parity is reached.

Open questions

  • Examples: sphinx-gallery runs the scripts and embeds plots. What's the MkDocs equivalent we want (mkdocs-gallery vs. pre-rendered)?
  • Versioned docs (e.g. mike)?

Reference: the MkDocs Material + properdocs + mkdocstrings setup in the MyoGestic repo.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions