Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found a file formatted with Markdown. Could you guys suggest what viewer that I could use to view this type of files? Hopefully one without gui (if it's possible)

Update I was actually looking for a viewer that could parse markdown file format that does not need any conversion. But something close to that should be ok.

share|improve this question
A markdown file can just be read when you open it in an editor, you don't really need fancy tools to read it. What do you want it for/what format do you want it to be in? – kasterma Nov 17 '10 at 20:29
I think what I want is some sort of browser addon that lets me open markdown files just like it was an html file. Does that exist? – PapaFreud Nov 29 '12 at 9:58
There are many versions of "markdown". Technically, LaTeX, HTML are markdowns, as is the italics bold bold italics and USE links... – vonbrand Dec 27 '15 at 21:08
retext now on github as @Fran recommended – Dr Beco Jun 7 at 2:35

15 Answers 15

up vote 19 down vote accepted

The following website provides a tool that will translate markdown into HTML:


Once you convert the file to HTML, there are a number of command line tools to use to view the file. Using a test file that contains markdown formatted-text, I found the following worked nicely.

$ wget http://daringfireball.net/projects/downloads/Markdown_1.0.1.zip
$ unzip Markdown_1.0.1.zip
$ cd Markdown_1.0.1/
$ ./Markdown.pl ~/testfile.markdown | html2text

html2text is one of many tools you can use to view html formatted text from the command line. Another option, if you want slightly nicer output would be to use lynx:

$ ./Markdown.pl ~/testfile.markdown | lynx -stdin

If you are an emacs user, someone has written a mode for markdown which is available here: http://jblevins.org/projects/markdown-mode/. This provides nice syntax highlighting as can be seen in the screenshot on that website.

All of these tools should be available for slackware.

share|improve this answer
In VIM you can get syntax highlight by manually setting the syntax to markdown if it isn't recognized. :set syntax=mkd – Gert Nov 17 '10 at 9:48
I never would have thought to use -stdin and lynx, very clever indeed and just what I needed. – NickO Jan 7 '14 at 19:39

Using pandoc and lynx without creating temporary files:

pandoc file.md | lynx -stdin

On debian systems you can install with:

apt-get install pandoc
share|improve this answer
(note: pandoc is in haskell) – fche Mar 30 '15 at 15:55
Or just pandoc -t plain file.md | less – Adriano P Sep 26 '15 at 17:53
how do you install pandoc? – chovy Jan 21 at 6:38

Is a GUI program, but I find useful for this task ReText, that is an editor for Markdown and reStructuredText with a preview mode:

ReText screenshot

However, if you need see the file of ReText from a terminal, one option could be convert the marddown to html with pandoc and see the html copy in lynx:

pandoc file.mkd > file.html ; lynx file.html
share|improve this answer
I use retext exclusively. It hasn't failed me yet but then I haven't used it as extensively as some others have. I use it exclusively to make issues in github (which sadly uses markdown) and has no GUI for it. – shirish Dec 2 '14 at 20:18
Thanks for the tip Fran, exactly what I was looking for. Only thing I've noticed ReText missing so far is a refresh or "load on change" feature so you can use it in conjunction with other editors. – Ash Oct 4 '15 at 11:40
Very nice tip. Also recommended here: softwarerecs.stackexchange.com/a/17740 The repository has changed to github: github.com/retext-project/retext – Dr Beco Jun 7 at 2:34

I wrote a lightweight terminal markdown viewer in python, for CLI or as lib:

It supports e.g. tables, admonitions and tons of color themes.

mdv [-t THEME] [-T C_THEME] [-x] [-l] [-L] [-c COLS] [-f FROM] [-m] [-M   DIR] [-H] [-A] [MDFILE]

MDFILE    : Path to markdown file
-t THEME  : Key within the color ansi_table.json. 'random' accepted.
-T C_THEME: Theme for code highlight. If not set: Use THEME.
-l        : Light background (not yet supported)
-L        : Display links
-x        : Do not try guess code lexer (guessing is a bit slow)
-f FROM   : Display FROM given substring of the file.
-m        : Monitor file for changes and redisplay FROM given substring
-M DIR    : Monitor directory for markdown file changes
-c COLS   : Fix columns to this (default: your terminal width)
-A        : Strip all ansi (no colors then)
-H        : Print html version

   enter image description here

share|improve this answer
I really like this, but it is missing some basic usability features, such as: not displaying the theme by default when run as an app (I really don't care about what theme is used, let me define one in my alias and then just display the markdown please), justifying paragraph text (not asking for advanced hyphenation here but at least word-wrap), and it also does not seem to handle paragraph breaks properly for some odd reason. It's a really good start and has lots of useful features like code syntax highlighting, but is basically not usable in its current state, sad because it came so close. – Thomas Aug 23 '15 at 8:20

Note: credits to @Joe's answer.

You can use Grip, which renders the Markdown exactly as GitHub would (it uses the GitHub markdown API).

Install it with pip:

pip install grip

Run it from the directory in which the README file resides:


The result:

enter image description here

share|improve this answer

There's also Discount, David Parsons' C implementation of John Gruber's Markdown text to html language. Discount consists of several command-line tools including markdown, mkd2html, makepage, mktags and theme.


In addition, there's an implementation of markdown in C, using a PEG grammar.


On Mac OS X you also may have a look at qlmarkdown, a QuickLook generator for Markdown files.

share|improve this answer

I know you said you preferred a non-GUI application, but I am currently working on a GUI application called DownMarker which does this. You can find the source in a mercurial repository here. You can find a stand-alone executable to run with mono or .NET here.

Caveat: It is far from finished and only occasionally tested on linux/mono. Last test I did was on Mono 2.6. If you want to build it yourself will need a recent version of mercurial to clone the repository, and MonoDevelop to compile the application.

share|improve this answer
It opens in my Windows 7 machine 64 bits, but it doesn't render the md document, it only shows the source. Nonetheless, it's amazing that a mono application just ran without a crash in my machine. :) – GmonC Nov 21 '10 at 0:44

2 more tools:
- Showdown is JavaScript port or Markdown: https://github.com/coreyti/showdown . You can use it only from browser
- txt2tags can read Markdown format but it adds a lot of new options and featues: http://txt2tags.org/online.php

share|improve this answer

For those who prefer w3m (vi style bindings):

pandoc file.md | w3m -T text/html

I put it in a script, mdview.sh, and put that in my path:

pandoc "$1" | w3m -T text/html
share|improve this answer

Assuming you want to see what the html looks like: Use a web browser (with an addon) as a viewer.

For example, for Google Chrome there's TextDown which also lets you edit files straight in the browser and see a live preview.

After adding it, you also need to go to chrome://chrome/extensions/ and check "allow access to file URLs" so you can open local files. A warning though: if you save (shift-ctrl-s) TextDown does not save to the file you opened but to your downloads folder.

share|improve this answer
There is also this extension for Firefox, which you can then get working by following this. – Wilf Feb 28 '14 at 13:50

A couple comments asked about or mentioned the possibility of using a browser add-on. I like this approach because I can edit markdown files in any Linux text editor (from nano to vim to Kate) and view the files in Firefox (my browser of choice).

I simply installed this Firefox add-on and it worked out of the box on Kubuntu 12.04 and Firefox 33.0. No tweaks required.

Markdown Viewer :: Add-ons for Firefox

(I also like ReText, but I would prefer to see something like ReText implemented as a plugin for Kate. ReText lacks too many features to compete with mature editors like Kate.)

share|improve this answer

Here is a commandline script which opens up a markdown file in your browser after converting it into html: http://minhajuddin.com/2012/03/16/markdown-viewer-script-for-your-markdown-documents/

share|improve this answer

You could have a look at mad which is very easy to use:

mad file.md
share|improve this answer

An easy solution for most situations: copy/paste the markdown into a viewer in the "cloud." Here are two choices:

  1. Dillinger.io
  2. Dingus

Nothing to install! Cross platform! Cross browser! Always available!

Disadvantages: could be hassle for large files, standard cloud application security issues.

share|improve this answer

I suggest taking a look at Atom. It is an excellent text editor with in-built markdown preview. I don't usually use the markdown preview mode as it has a serious bug - line breaks (unless they come in pairs which indicates a <p> tag's contents) are preserved in the preview. But the syntax highlight mode is so good (since Markdown is optimized to be human readable and Atom's colorization is excellent) that I usually end up reading markdown files in source view mode.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.