Skip to main content
Pre-release

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

sphinx-mdinclude

Sphinx extension for including or writing pages in Markdown format.

version documentation changelog license

sphinx-mdinclude is a simple Sphinx extension that enables including Markdown documents from within reStructuredText. It provides the .. mdinclude:: directive, and automatically converts the content of Markdown documents to reStructuredText format.

sphinx-mdinclude is a fork of m2r and m2r2, focused only on providing a Sphinx extension.

Features

  • Basic markdown and some extensions (see below)
    • inline/block-level raw html
    • fenced-code block
    • tables
    • footnotes ([^1])
  • Inline- and Block-level rst markups
    • single- and multi-line directives (.. directive::)
    • inline-roles (:code:`print(1)` ...)
    • ref-link (see `ref`_)
    • footnotes ([#fn]_)
    • math extension inspired by recommonmark
  • Sphinx extension
    • add markdown support for sphinx
    • mdinclude directive to include markdown from md or rst files
    • option to parse relative links into ref and doc directives (m2r_parse_relative_links)
    • option to render mermaid blocks as graphs with sphinxcontrib.mermaid (m2r_use_mermaid, default: auto)
      • auto means that m2r2 will check if sphinxcontrib.mermaid has been added to the extensions list

Restrictions

  • In the rst's directives, markdown is not available. Please write in rst.
  • Column alignment of tables is not supported. (rst does not support this feature)
  • Heading with overline-and-underline is not supported.
    • Heading with underline is OK
  • Rst heading marks are currently hard-coded and unchangeable.
    • H1: =, H2: -, H3: ^, H4: ~, H5: ", H6: #

Installation

Python 3.6 or newer is required.

pip install sphinx-mdinclude

Usage

In your Sphinx conf.py, add the following lines:

extensions = [
    ...,
    'sphinx_mdinclude',
]

Markdown files with the .md extension will be loaded and used by Sphinx, similar to any other .rst files.

To include Markdown files within other files, use the .. mdinclude:: <filename> directive. This applies the conversion from Markdown to reStructuredText format.

License

sphinx-mdinclude is copyright Hiroyuki Takagi, CrossNox, and John Reese, and licensed under the MIT license. I am providing code in this repository to you under an open source license. This is my personal repository; the license you receive to my code is from me and not from my employer. See the LICENSE file for details.

Metadata

Release files for sphinx_mdinclude 0.4.0b1

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_mdinclude 0.4.0b1
File Size Uploaded Provenance Actions
sphinx_mdinclude-0.4.0b1.tar.gz 20.6 kB Without provenance Details for sphinx_mdinclude-0.4.0b1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sphinx_mdinclude 0.4.0b1
File Interpreter ABI Platform Actions
sphinx_mdinclude-0.4.0b1-py3-none-any.whl Python 3 none any Details for sphinx_mdinclude-0.4.0b1-py3-none-any.whl

Total release size: 34.8 kB

Release files / sphinx_mdinclude-0.4.0b1.tar.gz

Download URL sphinx_mdinclude-0.4.0b1.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8918ecee15cdc992f226743ee6a4d6c64da194315fddaaa169d1c9f07d07590c
BLAKE2b-256 checksum
How to use checksums
90f0fa91d2022e07e5f07d477b25f1397caa9010627b85897b83943e60027bb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.26.0

Release files / sphinx_mdinclude-0.4.0b1-py3-none-any.whl

Download URL sphinx_mdinclude-0.4.0b1-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9fd84f48db5bae6c54d04154ce8b65904a6318a95e8444031d66a9b385cf960d
BLAKE2b-256 checksum
How to use checksums
e42e1d4176bdcc5efddd36de4563c1e40657262f02db2eb4fcdeaa4450551faa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.26.0

Security for sphinx_mdinclude 0.4.0b1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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