Sphinx Markdown Builder

0.6.10 · active · verified Tue Apr 14

sphinx-markdown-builder is a Sphinx extension that enables the generation of documentation in Markdown format. It extends Sphinx's build capabilities, allowing users to build their existing reStructuredText or MyST Markdown projects into standard Markdown files. The current version is 0.6.10, and it generally follows a release cadence tied to major Sphinx versions and critical bug fixes.

Warnings

Install

Quickstart

To quickly generate Markdown from your Sphinx project, first create a basic Sphinx project (e.g., `sphinx-quickstart docs`). Then, modify `docs/conf.py` to include `sphinx_markdown_builder` in your `extensions` list and set `markdown_builder_uri = '{path}.md'` for correct file extensions. Finally, run `sphinx-build -b markdown docs _build/markdown` from your project's root directory to generate Markdown output.

# Save this as docs/conf.py (after running sphinx-quickstart)
import os
import sys
# Assuming your Sphinx project root is 'docs'
sys.path.insert(0, os.path.abspath('.'))

project = 'My Markdown Docs'
copyright = '2024, AI Assistant'
extensions = [
    'sphinx_markdown_builder',
    # Other Sphinx extensions can go here, e.g., 'sphinx.ext.autodoc'
]

# Configure output Markdown file extension
markdown_builder_uri = '{path}.md'

# Minimal settings for Markdown output
# Add other Sphinx standard configurations as needed
html_theme = 'alabaster' # A theme is typically required by Sphinx init

# Example index.rst content (save as docs/index.rst):
# ===================
# My Markdown Docs
# ===================
#
# Hello World!

view raw JSON →