Markdown — Sphinx documentation (2024)

Markdown is a lightweight markup language with a simplistic plain textformatting syntax. It exists in many syntactically different flavors. Tosupport Markdown-based documentation, Sphinx can use MyST-Parser.MyST-Parser is a Docutils bridge to markdown-it-py, a Python package forparsing the CommonMark Markdown flavor.

Configuration

To configure your Sphinx project for Markdown support, proceed as follows:

  1. Install the Markdown parser MyST-Parser:

  2. Add myst_parser to thelist of configured extensions:

    extensions = ['myst_parser']

    Note

    MyST-Parser requires Sphinx 2.1 or newer.

  3. If you want to use Markdown files with extensions other than .md, adjustthe source_suffix variable. The following example configuresSphinx to parse all files with the extensions .md and .txt asMarkdown:

    source_suffix = { '.rst': 'restructuredtext', '.txt': 'markdown', '.md': 'markdown',}
  4. You can further configure MyST-Parser to allow custom syntax thatstandard CommonMark doesn’t support. Read more in the MyST-Parserdocumentation.

Markdown — Sphinx documentation (2024)
Top Articles
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 6383

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.