I made a toy "literate programming" implementation made of markdown files with python code fences. IPython/Jupyter notebooks are the heavy-case, but this is 1000x simpler.
A very toy example: markdown (first), extracted python to run (second).
Enhancements:
I think it would be interesting to exec() the extracted code, but there's obviously some risk there. Another idea would be to copy the surrounding markdown into comments.
2 media files