https://github.com/pawamoy/markdown-pycon
Markdown extension to parse `pycon` code blocks without indentation or fences.
https://github.com/pawamoy/markdown-pycon
markdown markdown-extension pycon python python-markdown
Last synced: 24 days ago
JSON representation
Markdown extension to parse `pycon` code blocks without indentation or fences.
- Host: GitHub
- URL: https://github.com/pawamoy/markdown-pycon
- Owner: pawamoy
- License: isc
- Created: 2023-09-01T19:21:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-10T01:07:21.000Z (about 1 year ago)
- Last Synced: 2025-11-06T06:18:17.017Z (4 months ago)
- Topics: markdown, markdown-extension, pycon, python, python-markdown
- Language: Python
- Homepage: https://pawamoy.github.io/markdown-pycon/
- Size: 603 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Markdown PyCon
[](https://github.com/pawamoy/markdown-pycon/actions?query=workflow%3Aci)
[](https://pawamoy.github.io/markdown-pycon/)
[](https://pypi.org/project/markdown-pycon/)
[](https://app.gitter.im/#/room/#markdown-pycon:gitter.im)
Markdown extension to parse `pycon` code blocks without indentation or fences.
## Installation
```bash
pip install markdown-pycon
```
## Configuration
This extension relies on the
[Highlight](https://facelessuser.github.io/pymdown-extensions/extensions/highlight/)
extension of
[PyMdown Extensions](https://facelessuser.github.io/pymdown-extensions/).
Configure from Python:
```python
from markdown import Markdown
Markdown(extensions=["pycon"])
```
...or in MkDocs configuration file, as a Markdown extension:
```yaml
# mkdocs.yml
markdown_extensions:
- pycon
```
## Usage
In your Markdown documents, simply write your `pycon` code blocks
without indentation or fences (triple backticks):
```md
>>> print("This is a pycon code block")
This is a pycon code block
```
This will get rendered as:
```pycon
>>> print("This is a pycon code block")
This is a pycon code block
```
[Doctest flags](https://docs.python.org/3/library/doctest.html#option-flags)
will be removed from the code lines.