Skip to content

Markdown PyCon¤

documentation gitpod gitter

Markdown extension to parse pycon code blocks without indentation or fences.

Installation¤

This project is available to sponsors only, through my Insiders program. See Insiders explanation and installation instructions.

Configuration¤

This extension relies on the Highlight extension of PyMdown Extensions.

Configure from Python:

from markdown import Markdown

Markdown(extensions=["pycon"])

...or in MkDocs configuration file, as a Markdown extension:

# mkdocs.yml
markdown_extensions:
- pycon

Usage¤

In your Markdown documents, simply write your pycon code blocks without indentation or fences (triple backticks):

>>> print("This is a pycon code block")
This is a pycon code block

This will get rendered as:

>>> print("This is a pycon code block")
This is a pycon code block

Doctest flags will be removed from the code lines.