Skip to content

Show HN: Python) Markdown Exec, execute code blocks and render their output

pawamoy.github.io
2 pointsPawamoydiscuss
On HN

Hey everyone, here's an extension I made for Python-Markdown (https://github.com/Python-Markdown/markdown). It builds on top of PyMDown Extensions' SuperFences (https://facelessuser.github.io/pymdown-extensions/extensions...), and allows Markdown writers to execute their Markdown code blocks to render the execution output in place of / in addition to the code blocks.

Languages supported: python/pycon; sh/bash/console; md (literate programming!)

Special fences: tree, to easily render file trees; pyodide, to render an interactive Ace.js editor that runs Python code thanks to Pyodide

Adding examples to the gallery is quite fun :) Don't hesitate to create an issue if you'd like me to add examples for another tool or Python library!

Comments

No comments yet.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.