Skip to main content

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 (md_parse_relative_links)

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 Amethyst 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.

Release files for sphinx_mdinclude 0.6.0

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.6.0
File Size Uploaded
sphinx_mdinclude-0.6.0.tar.gz 65.0 kB Details

Built distribution (wheel)

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

Total release size: 81.8 kB

Release files / sphinx_mdinclude-0.6.0.tar.gz

Download URL sphinx_mdinclude-0.6.0.tar.gz
Size 65.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b1cb4dfa22ce17ca20e90e34d4349d8a97c5052709d9c4eed051cdabb615b20b
BLAKE2b-256 checksum
How to use checksums
827c458b0259c20ac24c2994ba4bed005814e52bb78cf905183cdebf79928f96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / sphinx_mdinclude-0.6.0-py3-none-any.whl

Download URL sphinx_mdinclude-0.6.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
764b6aeee28002b9d02060758266761a2c724805594d264b19e6ceeaa3bad393
BLAKE2b-256 checksum
How to use checksums
6c67a2002954682cad0ab8fd16f9c8d3325d490c3a8ffd5bad91f7eb1610f5e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

0.6.2

2 release files

0.6.1

2 release files

This release

0.6.0 This release

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

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