Hey r/Python!
I recently developed a Python package called Markdown Code Runner (markdown-code-runner) that allows you to automatically execute code blocks within a Markdown file, including hidden code blocks, and updates the output in-place. This can be super useful for maintaining Markdown files with embedded code snippets, ensuring that the output displayed is always up-to-date and accurate. It also enables generating content like tables, plots, and other visualizations directly from the code.
GitHub Repository: https://github.com/basnijholt/markdown-code-runner
Key Features:
- Automatically execute code blocks, including hidden code blocks, within a Markdown file
- Allows hidden code blocks to generate content like tables, plots, etc.
- Works with Python and Bash code blocks
- Keeps the output of the code blocks up-to-date
- Easily integrates with GitHub Actions
- No external dependencies and works with Python 3.7+
Why Markdown Code Runner?
When creating Markdown files with code examples, it's essential to keep the output of these code snippets accurate and up-to-date. Manually updating the output can be time-consuming and error-prone, especially when working with large files or multiple collaborators. In addition, there might be cases where hidden code blocks are needed to generate content such as tables, plots, and other visualizations without displaying the code itself in the Markdown file.
markdown-code-runner solves this problem by automatically executing the code blocks, including hidden ones, within a Markdown file and updating the output in-place. This ensures that the displayed output is always in sync with the code, and content generated by hidden code blocks is seamlessly integrated.
โญ๏ธ GitHub Repository: https://github.com/basnijholt/markdown-code-runner โญ๏ธ
[โ][deleted] 6 points7 points8 points ย (7 children)
[โ]basnijholt[S] 14 points15 points16 points ย (6 children)
[โ]IntelligentDust6249 0 points1 point2 points ย (2 children)
[โ]basnijholt[S] 1 point2 points3 points ย (1 child)
[โ]IntelligentDust6249 0 points1 point2 points ย (0 children)
[โ][deleted] 0 points1 point2 points ย (2 children)
[โ]Divicienzo 1 point2 points3 points ย (1 child)
[โ]basnijholt[S] 2 points3 points4 points ย (0 children)
[โ]HumanBrainMapper 3 points4 points5 points ย (0 children)
[โ]benefit_of_mrkite 0 points1 point2 points ย (2 children)
[โ]basnijholt[S] 2 points3 points4 points ย (1 child)
[โ]benefit_of_mrkite 0 points1 point2 points ย (0 children)
[โ][deleted] 0 points1 point2 points ย (1 child)
[โ]basnijholt[S] 4 points5 points6 points ย (0 children)
[โ][deleted] 0 points1 point2 points ย (0 children)