Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

sphinx_mkdocs_migrate

PyPI version Documentation Status License: Apache 2.0

sphinx-mkdocs-migrate (sphinx-migrate) is a deterministic, evidence-driven analyzer and migration engine that safely converts MkDocs and Material for MkDocs documentation projects to Sphinx + MyST Parser.


Key Principles & Design Boundaries

What sphinx-migrate Does

  • Evidence-Driven Subsystem Analysis: Inspects mkdocs.yml, directory structures, theme features, Markdown extensions, and plugins.
  • Deterministic, Read-Only Planning: Generates a canonical MigrationPlan with stable hashes and provenance tracking for every extension and package.
  • Byte-Preserving Transformation: Transforms only specific non-standard syntax spans (e.g. tabs, dropdowns, includes) into native MyST/Sphinx directives while guaranteeing byte-for-byte identity on untouched Markdown.
  • AST-Guided API Migration: Resolves Python symbols statically (ast.parse) without executing untrusted repository code. Conservative manual boundary for re-exports and ambiguities.
  • Dual Validation Engine: Performs structural Markdown AST validation and real isolated Sphinx HTML builds in an isolated sandbox.

What sphinx-migrate Does NOT Do

  • No Speculative Heuristics: If a syntax construct or custom plugin cannot be deterministically mapped, it is routed to MANUAL or UNSUPPORTED rather than guessed.
  • No Source Code Mutation: Does not rewrite Python .py source code or docstrings.
  • Source-Faithful Theme Mapping: Material for MkDocs maps to sphinx_immaterial; the planned target theme and its package are preserved in generated conf.py rather than being silently replaced during validation.
  • Build Success != Runtime Equivalence: A successful Sphinx build proves structural and buildability correctness; it does not guarantee visual or JavaScript runtime identity with MkDocs Material.

Installation

pip install sphinx-mkdocs-migrate

CLI Workflow

The migration lifecycle consists of 4 distinct commands:

sphinx-migrate analyze   # 1. Factual project & subsystem inspection
       ↓
sphinx-migrate plan      # 2. Deterministic, read-only MigrationPlan generation
       ↓
sphinx-migrate migrate   # 3. Dry-run diffing or atomic disk transformation
       ↓
sphinx-migrate validate  # 4. AST validation & isolated sandbox Sphinx build

1. Project Inspection (analyze)

sphinx-migrate analyze path/to/project
# Machine-readable JSON output:
sphinx-migrate analyze path/to/project --json-output

2. Migration Planning(plan)

# Human-readable summary with Rich tables:
sphinx-migrate plan path/to/project

# Export canonical plan JSON:
sphinx-migrate plan path/to/project --output-json plan.json

3. Transformation & Scaffolding (migrate)

# Dry-run with unified diff preview (no disk mutations):
sphinx-migrate migrate path/to/project --diff

# Apply changes to disk and scaffold conf.py:
sphinx-migrate migrate path/to/project --apply

# Overwrite conflicting existing conf.py:
sphinx-migrate migrate path/to/project --apply --force-conf

4. Build Validation(validate)

# Full isolated sandbox Sphinx build:
sphinx-migrate validate path/to/project --build

# Strict mode (fail on any Sphinx warnings):
sphinx-migrate validate path/to/project --build --strict

Supported Feature Policies

Source Feature Category Action Target / Resolution Provenance
content.code.copy THEME_FEATURE ENABLE_EXTENSION sphinx_copybutton / sphinx-copybutton>=0.5.2 FEATURE_POLICY
content.tabs.link THEME_FEATURE ENABLE_EXTENSION sphinx_design / sphinx-design>=0.5.0 FEATURE_POLICY
pymdownx.tabbed MARKDOWN_EXTENSION TRANSFORM sphinx-design ({tab-set}, {tab-item}) EXTENSION_POLICY
pymdownx.details MARKDOWN_EXTENSION TRANSFORM sphinx-design ({dropdown}) EXTENSION_POLICY
pymdownx.superfences MARKDOWN_EXTENSION PRESERVE MyST colon_fence EXTENSION_POLICY
pymdownx.arithmatex MARKDOWN_EXTENSION PRESERVE MyST dollarmath EXTENSION_POLICY
pymdownx.snippets MARKDOWN_EXTENSION TRANSFORM MyST {include} / literalinclude EXTENSION_POLICY
pymdownx.emoji MARKDOWN_EXTENSION MANUAL Manual review of icon shortcodes (:smile:) MANUAL
mkdocstrings PLUGIN TRANSFORM sphinx.ext.autodoc + sphinx.ext.napoleon EXTENSION_POLICY
search.share THEME_FEATURE UNSUPPORTED No static Sphinx HTML equivalent UNSUPPORTED

Roadmap & Future Evolution

While sphinx-mkdocs-migrate is currently focused on high-fidelity migration from MkDocs to Sphinx + MyST, our planned roadmap includes full bi-directional support:

  • Phase 1 (Current): Full-fidelity MkDocs & Material for MkDocs ➔ Sphinx + MyST migration with 100% AST byte preservation.
  • Phase 2 (Bi-Directional): Reverse migration (Sphinx + MyST ➔ MkDocs + Material).

See our full Roadmap Document for details.


Contributors

Thank you to everyone who has contributed to sphinx-mkdocs-migrate!

Please see our Contributors List for the full list of contributors.


License

Licensed under the Apache License, Version 2.0.

Release files for sphinx-mkdocs-migrate 0.0.1.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-mkdocs-migrate 0.0.1.dev1
File Size Uploaded
sphinx_mkdocs_migrate-0.0.1.dev1.tar.gz 100.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-mkdocs-migrate 0.0.1.dev1
File Interpreter ABI Platform
sphinx_mkdocs_migrate-0.0.1.dev1-py3-none-any.whl Python 3 none any Details

Total release size: 217.6 kB

Release files / sphinx_mkdocs_migrate-0.0.1.dev1.tar.gz

Download URL sphinx_mkdocs_migrate-0.0.1.dev1.tar.gz
Size 100.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4c987fb004dd67dc5cddd5eb37165e6b61b425650ee4bac2a34f0619807683d7
BLAKE2b-256 checksum
How to use checksums
c1c6400dd0ba5c14abafe0cf884e3ddba88b4233fca0dd8f39fca3e14ad0f37f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / sphinx_mkdocs_migrate-0.0.1.dev1-py3-none-any.whl

Download URL sphinx_mkdocs_migrate-0.0.1.dev1-py3-none-any.whl
Size 117.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7f7eb35ded8849b3915aae9766bf2115c448dba0feb0ba8fe02e1624e1cdade
BLAKE2b-256 checksum
How to use checksums
6743e9ffc6a56d96c83786a079b45f32d1a1f02cbf1be84b96344944d0ec898a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.1.dev1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page