Sphinx Markdown Tables

0.0.17 · active · verified Thu Apr 16

sphinx-markdown-tables is a Sphinx extension designed to render tables written in GitHub Flavored Markdown (GFM) within Sphinx documentation projects. It enables users to utilize familiar Markdown table syntax for documentation generated by Sphinx. The current version is 0.0.17. While not on a strict release cadence, it receives updates for bug fixes and compatibility with new Sphinx versions.

Common errors

Warnings

Install

Quickstart

To use `sphinx-markdown-tables`, add it to the `extensions` list in your Sphinx `conf.py`. This example also includes `myst_parser`, which is commonly used to enable Sphinx to parse Markdown files (`.md`). After configuration, you can use GitHub Flavored Markdown (GFM) table syntax in your Markdown source files, and Sphinx will render them as HTML tables.

# conf.py
# Minimal Sphinx configuration for sphinx-markdown-tables
# Make sure you have 'myst_parser' installed if using .md files.
# pip install myst-parser

project = 'My Markdown Tables Project'
copyright = '2024, Example Author'
extensions = [
    'myst_parser', # Required for Sphinx to parse .md files
    'sphinx_markdown_tables' # The extension itself
]
# You would also set source_suffix appropriately, e.g.,
source_suffix = {
    '.rst': 'restructuredtext',
    '.md': 'markdown',
}
html_theme = 'alabaster' # Or any other Sphinx theme

# Example index.md content for using markdown tables:
# ```markdown
# # My Document
# 
# Here is a table:
# 
# | Header 1 | Header 2 | Header 3 |
# |----------|----------|----------|
# | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |
# | Row 2 Col 1 | Row 2 Col 2 | Row 2 Col 3 |
# ```

view raw JSON →