Search | Running | Sailfish OS | All Posts | About Me

Reading Markdown files on the FreeBSD CLI with Glow

January 10, 2025 — Nico Cartron

Context

I use Markdown more and more; combined with Nextcloud for files synchronisation, it is a perfect match for me, allowing to take notes on the go, organise files, projects, etc.

Quite often I would SSH into my home laptop to quickly edit a Markdown file, but sometimes I want to make sure the rendering is OK, especially when dealing with tables, which are easy to break.

I needed a Markdown viewer/renderer for the CLI, and something light.

Finding glow

The first results I found where either online viewers, or Markdown viewers that were included in much bigger projects, which was too much for me.

Then I found Glow which looked really great.
Cherry on the cake: it is part of FreeBSD's packages!

# pkg search glow
afterglow-1.6.2_2              Collection of graph-generating scripts
glow-1.5.1_7                   Render markdown on the CLI, with pizzazz!

Here is how a Markdown file with a table looks like normally:

And with glow rendering it:

(Note that I used -w to display a wider table):

glow --help:

  -w, --width uint      word-wrap at width

Tags: IT


I don't have any commenting system, but email me (nicolas at ncartron dot org) your comments!
If you like my work, you can buy me a coffee!