Markdown extension to parse pycon
code blocks without indentation or fences.
pip install markdown-pycon
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
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.