How to convert Markdown documents into HTML

and maybe add some pretty coloring for python codes

1. Install packages

pip3 install markdown
pip3 install Pygments

Where markdown is for converting file from markdown to html, and Pygments is for adding colored highlighting to the code blocks.

2. Converting

Just converting (this gives you only the body part of the html):

python3 -m markdown input.md > output.html

Adding coloring (make it capible for adding colors ):

python3 -m mardown -x codehilite input.md > output.html

3. CSS

pygmentize -S default -f html > codehilite.css

Add the css to your html file.

Reference

5 simple steps for converting Markdown documents into HTML and adding Python syntax highlighting