What Glow is
By the end of this chapter you can say, in one sentence, what Glow does to a Markdown document — and state the one rule that keeps its pretty page from misleading you.
Markdown shows you the source
Markdown is a way of writing formatted
text with plain characters: # for a
heading, ** around bold words,
pipes and dashes for a table. It was
designed to be readable as source,
and mostly it is. But "mostly" wears
thin. A wide table is a thicket of
pipes. A long document is a wall of
equal-looking paragraphs with the
headings hiding inside it. A task list
asks you to read [x] and [] as
"ticked" and "not ticked". Reading the
source is reading the instructions for
a page, not the page.
Glow shows you the page. It is a free, open-source program from the Charm project (the project lives at github.com/charmbracelet/glow), written in Go. Its own one-line description is "Render markdown on the CLI, with pizzazz!" — the first line of its README, which this guide's lab fetched and rendered in chapter 10. Unpacked, one run of Glow:
- reads a Markdown document from a file, from standard input, or from the web,
- renders it — headings become bands and larger-looking titles, tables are drawn with ruled lines, code blocks are coloured by language, links show their address, task lists show ticked and unticked boxes,
- and presents the result on the terminal: printed straight, handed to a pager, or opened in Glow's own full-screen reader. With no document named at all, it becomes a small file browser for the Markdown documents near you.
The rule: the rendering is a reading
Everything Glow shows you is an interpretation, made at the moment you look. It re-flows the text to a width (80 columns by default, whatever your terminal says), replaces some source marks with pictures and others with plain text, adds colour that exists nowhere in the file, and — chapter 14 is the ledger — leaves a few things out entirely. The file does not change. That sounds obvious, and it is the one idea this whole guide leans on:
The rendering is a reading of the document, not the document.
The rule matters because a reading can be mistaken for the original. A copied rendering carries thousands of colour escapes into whatever you paste it into. A footnote that Glow does not support is not "missing from the document" — it is missing from the reading. An image in the document appears as one line of text naming the image file, which is a fine way to read on a terminal, as long as you know that is what you are seeing. Later chapters point back to this rule wherever the reading could be confused with the document.
Where a rendered page earns its keep
Glow is at its best when you are reading, in a terminal, a document someone wrote to be read:
- the README of a project you have just cloned, without leaving the shell for a browser,
- notes and documentation kept in a repository or a notes folder, especially over an SSH session where there is no browser to open,
- a changelog or release notes file, minutes of a meeting, a checklist with boxes to tick — documents whose tables, headings and lists are the content.
It is the wrong tool when the source itself is what you care about: when you are about to edit the document, when a table's exact column widths matter, or when you need to see everything the file contains, the editor and the browser (chapter 13) are the honest readers. Glow also shows no pictures — chapter 5 is exact about what an image becomes.
This guide's lab ran Glow 3.0.0, the current release at the time of writing, taken straight from the project's release page; chapter 3 covers getting it.
Check: without looking back, say what Glow adds between the file and your eyes, and say the rule out loud once. If you can, you have this chapter.