Markdown viewer for file list

I’m looking for a command line Markdown viewer for many .md files somehow similar to image viewers.

I need:

  • simple/fast navigation: preferably left, right arrows (no combinations like :n, :p),
  • and a list of .md files as an argument or taken from current dir,
  • clean output is a plus.

It may be also achieved by some sophisticated pipe sequence or any customized parameters/shell variables. Anything that works.

Asked By: sZpak

||

I needed something similar a while ago, so today I sat down and cleaned up the code to make it somewhat useful. It’s licensed under GPLv3:

https://github.com/marcusmueller/markmedown

If you have access to textual >= 0.11.0 (as of 2023-11-17, that’s practically only the case on Fedora 39), you can directly run markmedown from that repository.

Otherwise, you’d want to install a newer textual in a virtualenv and then use that. To ease that for local installations, the repo contains a markmedown.sh setup and launcher script. Run it once from the repo:

git clone https://github.com/marcusmueller/markmedown
cd markmedown
./markmedown.sh

And then just copy markmedown.sh somewhere in your $PATH.

Usage is very simple:

markmedown.sh FILE1.md FILE2.md …

/ keys to switch between files, q to quit.

If you want to show an outline of each file on the side, add -t as option.

Animated demo

Answered By: Marcus Müller