7

I am working on a remote server that only has a terminal support. There are certain markdown files that I would like to read. However, as I don't have a GUI support, I am in need of a markdown reader/ something similar. The server has lynx installed. So, even if you can suggest some extension to lynx, it will work!

4 Answers 4

8

You can think of converting it to html with some tool like pandoc, then read the html with lynx. For eg, with pandoc:

pandoc file.md | lynx -stdin
6

This is old but for future googlers: I had the same problem and ended up adding this to ~/.bash_aliases:

function mdread {
    pandoc "$1" -f markdown -t html | lynx -stdin
}

Then simply do mdread foo.md, and it will open in lynx. This is possibly not optimal but a lot better than just looking at the source. You'll need pandoc and lynx of course.

3

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

https://github.com/axiros/terminal_markdown_viewer

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

2

Markdown is already in the most readable form for a console by design. Lynx displays HTML lists as bullet points using asterisks -- exactly the same way as you write Markdown manually.

tl;dr: What you need is known as a "text editor". Nothing more.

2
  • 6
    Consoles can display text in bold, and with inverted foreground/background, and most consoles can even display in color. This could provides for something more readable than displaying asterisks and underscores surrounding bold and italicized text, and hugely more readable than displaying backticks surrounding inline code-formatted text. While markdown is reasonably easy to read, it's decidedly not "the most readable form" to read documents in a terminal. Aug 4, 2012 at 3:41
  • 1
    Why not try a text editor with syntax highlighting? Vim is great for this. Just :set ft=markdown if it doesn't automatically recognize it.
    – Jonathan
    Aug 6, 2012 at 5:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .