CLI markdown viewer

Markdown is a very powerful and easy syntax, used to create rich text through a plain text editor and to format ReadMe files. The latter are the “main introduction” to the source code gatherd in a GitHub repository as well, so writing that kind of files in the most accurate way is really really important.

And, obviously, before loading a code on a remote repository, test it is the basic rule. To test a Markdown file you need a viewer…and how we prefer in this blog, and advice to you, can be only a terminal one.

A very good CLI markdown viewer is Terminal Markdown Viewer developed by Axiros GmbH.

The installation is pretty easy, but if you have parallel python versions installed from the arch-linux repositories you have to do some more steps.

It works for python2.7, which nowadays is at the version 2.7.10. As reported in official website it should have pip module already install. Unfortunately, not the version installed from the arch-linux repository.

Thus, first at all download get-pip.py:

wget https://bootstrap.pypa.io/get-pip.py

and install it for the version 2.7 of python:

sudo python2.7 get-pip.py

then install the markdown module, necessary to make the viewer working:

sudo python2.7 -m pip install markdown

Now clone the markdown viewer repository:

git clone https://github.com/axiros/terminal_markdown_viewer.git

and modify the first line of the mdv.py script with python2.7 in order to call the correct interpreter.
Then, just follow the installation instructions in the ReadMe of the GitHub page to create a bash alias and enjoy this powerful tool.

Happy hacking! GWH!

About Francesco Serafin

I am a PhD student at the Department of Civil, Environmental and Mechanical Engineering at the University of Trento. My two greatest loves: Computer Science and Water (take three with my Lenovo!:D). As a result, the aim of my life is to make both passions coexist. My gpg public key available at https://pgp.mit.edu

Leave a Reply

Your email address will not be published.

*