# Add MyST Markdown to Sphinx without assuming plain Markdown behavior

Canonical: https://githtml.com/guides/sphinx-myst-markdown-authoring-boundary
Published: 2026-11-23
Publisher: WaveTech LLC / gitHtml

Use MyST when a Sphinx project needs Markdown authoring together with Sphinx roles and directives, and document the enabled feature set. Test a small page before converting existing content. MyST is not a promise that every GitHub-specific construct works unchanged, nor that a page using Sphinx directives will render meaningfully in a generic Markdown viewer.

## Define what Markdown authors need from Sphinx

List the features the team needs beyond plain paragraphs and headings: API cross-references, admonitions, includes, or structured directives. Confirm that MyST is the appropriate parser for those requirements and identify the version used by the project. Avoid changing the whole source tree merely to make filenames end in md. A migration should preserve meaning, navigation, and reviewability. Keep the existing reStructuredText sources intact until the new fixture demonstrates the required behavior. Explain to contributors which parts of the source are portable Markdown and which depend on Sphinx and the configured MyST feature set.

## Build one page with a real reference

Add MyST through the maintained documentation dependency and extension configuration, then create a short page containing a heading, a code example, and one supported Sphinx-aware construct. The sample shows a note directive, but the project's real test should also exercise its important reference types. Build locally with warnings visible. Check whether the source is discovered and whether its directive content appears in the intended place. Do not enable every optional syntax extension without a concrete need; that expands the grammar authors must understand and can introduce surprising interpretations of otherwise ordinary punctuation.

````markdown
```{note}
This sample note is interpreted by the configured MyST/Sphinx build.
```
````

## Compare migration results at the semantic level

If converting an existing page, compare heading hierarchy, links, notes, code examples, and labels with the original output. A simple text diff between source formats will not reveal all semantic losses. Follow cross-references arriving from other pages, because renamed labels can break navigation even when the migrated page looks complete. Document the accepted authoring conventions and preserve a fixture for future parser upgrades. Tell readers and contributors that generic Markdown previews may show directive syntax literally. If an HTML reading copy is needed, generate it through the configured Sphinx build and inspect that artifact; the raw MyST source is not itself a portable rendered document. For mixed-format projects, provide one accepted example in each source language. Contributors can then choose the format appropriate to the page without guessing whether one syntax is being phased out.

1. List required Sphinx-aware features before selecting extensions or migrating files.
2. Create one fixture that exercises a meaningful directive and cross-reference.
3. Build with warnings visible and compare semantics with the previous output.
4. Document which syntax depends on MyST so generic previews are not mistaken for authoritative builds.

## Sources and further reading

- [MyST Markdown parser](https://myst-parser.readthedocs.io/en/latest/)
- [Sphinx configuration](https://www.sphinx-doc.org/en/master/usage/configuration.html)

## Related guides

- [Triage Sphinx unresolved references with nitpicky builds](https://githtml.com/guides/sphinx-nitpicky-warning-triage)
- [Check an Astro Starlight documentation build locally](https://githtml.com/guides/starlight-local-build-content-validation)
- [Organize Starlight sidebars around reader tasks](https://githtml.com/guides/starlight-sidebar-order-and-groups)
- [Check VitePress base paths before serving docs in a subdirectory](https://githtml.com/guides/vitepress-base-path-subdirectory-check)

Editorial approach: https://githtml.com/guides/about
