Execute Python code in Markdown files and captures the output
Copyright 2022 Sebastiaan Mathôt
usage: markdown_code_exec.py [-h] [-i INPUT] [-o OUTPUT]
optional arguments: -h, --help show this help message and exit -i INPUT, --input INPUT input markdown file -o OUTPUT, --output OUTPUT output markdown file
markdown_code_exec.parse_text(md)
Takes a str
containing markdown text, finds code blocks in the
markdown, executes these code blocks and captures the output, and then
embeds the captured output in the markdown.
- md: str : The input markdown string
str The compiled markdown string
markdown_code_exec.parse_file(src, dst)
Takes a markdown input file, executes code blocks while capturing output and writes the result to a new output file.
src: str The full path to the input file dst: str The full path to the output file
GNU General Public License 3