A Python Markdown extension to add blockcode from an existing file containing the code.
All you have to do is to add a tag like {% addcode file.py %}
in your markdown file and the code will be automatically added into a blockcode.
Just drop it in the extensions folder of the markdown package: markdown/extensions
Let's say you have a script.py
file with the following lines :
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
class AddCodePreprocessor(Preprocessor):
blablabla...
Now add to your text.markdown file the following line :
And the content of script.py will be added as a blockcode in text.html
How to run the unit testspip install markdown
addcode.py
file into site-packages/markdown/extensions/
markdown_py -x addcode myfile.markdown > output.html
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4