Previewing GitHub flavored markdown on a local web server using grip
I am writing most program documentation in markdown these days and displaying it in a wiki on GitHub. Of course, I don’t want to edit the source code on GitHub and will typically be doing that in emacs on my local machine. I was looking at different options for previewing the markdown and wanted exactly the appearance that would be rendered on GitHub. I found a nice Python program named grip that uses the GitHub markdown API to display markdown in a browser. These days I run all Python programs in a virtual environment so my installation procedure is as follows:
$ python3 -m venv vgrip $ source venv/bin/activate (vgrip)$ python -m pip install grip (vgrip)$ grip myfile.md
This produces a virtual web server that you can view in your browser, whenever the file is edited the view is automatically updated. GitHub now supports inclusion of equations in MathJax format but unfortunately
grip does not currently process MathJax code. An alternative that processes GitHub style MathJax inline code is the Chrome Markdown Viewer Extension.
Enjoy Reading This Article?
Here are some more articles you might like to read next: