Produce a single unified and beautiful HTML document from a Markdown file.
A standard markdown compiler produces raw HTML with no stylesheets attached, which is usually pretty ugly. Any images linked from the markdown file would also be linked from the generated HTML file and you need to attach them along with the html file if you want to send the file to someone.
mdunify is a very simple script to compile your markdown files and produce a single HTML file with any images included in that HTML file.
The generated file will contain some CSS so that the appearance of the document is somewhat beautiful. Currently, these stylesheets include sensible typography defaults from the blueprint-css project.
example/example.md.html included in this
repository were generated using mdunify.
Install and dependencies
After installing the following dependencies using
easy_install, you can simply clone this repository and run
You need the following packages installed:
- markdown - You can easily install this package using
pip install markdown
- argparse - You don't need this library if your are using python >= 2.7.
You can install argparse using
pip install argparse
Convert a file
To convert a file you can use the following command:
python mdunify.py file.md
This will generate a file named file.md.html
You can obtain a summary of the options available with
python mdunify.py --help.
To disable image in-lining you can use
Adjust the template
You can easily adjust the template used by mdunify:
- Copy the
template.tplfile to the same dir as your markdown file
- Edit the
*.tplfile according to your needs
- Run mdunify with
python file.md -t template.tpl