Is a GUI program, but I find useful for this task ReText, that is an editor for Markdown and reStructuredText with a preview mode:
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
Edit
There are a few more free markdown editors with preview available for *nix systems. Some in official repositories, others not, and each with their own strengths and weaknesses, but as suitable viewers I would like to highlight these:
Typora: It is still in beta phase, but it’s free meanwhile (it’s not clear how will be licensed the stable version). Although it is not FOSS, is perfect as markdown viewer because it work by default nearly as a WYSIWYG editor ("live preview mode") with a Outline panel (table of contents) that is very convenient for large files. The "source code mode" have syntax highlight, including bigger fonts for headings and italics for emphasis. And not only export to HTML, ODT and PDF. Also can import-export to several formats via pandoc
integration.
Ghostwriter: HTML preview only (non editable) but also have a nice outline panel and syntax highlight. Without import options, but export to several formats with pandoc and others processors (MultiMarkdown, Discount, or cmark) and have a live spellcheck via hunspell
/myspell
.
MdCharm: Similar to Retext, but support markdown (markdown extra) and MultiMarkdown. Show also an outline (ToC) panel.
For R Markdown
users, I should mention also editR. Is not a program, but a R package to edit/html preview of R Markdown in a browser. R Commander and RStudio also allow a easy preview in HTML, PDF or Word.
Now RStudio have a source and visual edit mode. The last is like type in a HTML preview, but we aware that this mode write the source markdown in their own way and rewrite any existing markdown with an alternative syntax. For example, the visual mode will change existing inline footnotes (as ^[text]
) by normal labeled footnotes. This will not change the output, but could be annoyingly that a minimal edit in visual mode might reformat the whole source text.