Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
3  
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

8 Answers 8

up vote 15 down vote accepted

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

http://daringfireball.net/projects/markdown/

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
3  
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 at 19:39

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.

http://www.pell.portland.or.us/~orc/Code/discount/

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

https://github.com/jgm/peg-markdown

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
1  
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

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 at 20:18

Using pandoc and lynx without creating temporary files:

pandoc file.md | lynx -stdin
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 at 13:50

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

Your Answer

 
discard

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.