From 3db5af78c110a952da68a9247ac9b72a1e178d0a Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sat, 2 May 2026 12:36:15 -0500 Subject: [PATCH] Add View Nicely Formatted Markdown From Terminal as a Workflow TIL --- README.md | 3 +- ...nicely-formatted-markdown-from-terminal.md | 39 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 workflow/view-nicely-formatted-markdown-from-terminal.md diff --git a/README.md b/README.md index 21979f5..8a87a16 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1783 TILs and counting..._ +_1784 TILs and counting..._ See some of the other learning resources I work on: @@ -2069,6 +2069,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Toggle Between Stories In Storybook](workflow/toggle-between-stories-in-storybook.md) - [Update asdf Plugins With Latest Package Versions](workflow/update-asdf-plugins-with-latest-package-versions.md) - [View A Nicely-Formatted CSV In Terminal](workflow/view-a-nicely-formatted-csv-in-terminal.md) +- [View Nicely Formatted Markdown From Terminal](workflow/view-nicely-formatted-markdown-from-terminal.md) - [View The PR For The Current GitHub Branch](workflow/view-the-pr-for-the-current-github-branch.md) ### XState diff --git a/workflow/view-nicely-formatted-markdown-from-terminal.md b/workflow/view-nicely-formatted-markdown-from-terminal.md new file mode 100644 index 0000000..e72b480 --- /dev/null +++ b/workflow/view-nicely-formatted-markdown-from-terminal.md @@ -0,0 +1,39 @@ +# View Nicely Formatted Markdown From Terminal + +The `glow` utility is CLI markdown renderer written in Go. It is part of the +CCU ([charmbraclet](https://github.com/charmbracelet) CLI universe). And yes, I +just made up _CCU_. + +`glow` is great because it processes and outputs a markdown file with some +styling tailored to a terminal including: + +- colors to emphasize things like headings +- styling of inline code snippets +- syntax highlighting for fenced code blocks +- rendering of markdown tables +- and a lot more that I'm not thinking to mention + +In the past I've installed this with `brew`, but I currently manage my `glow` +install with [this mise config](https://github.com/jbranchaud/dotfiles/blob/main/config/mise/config.toml?plain=1#L66). + +To view a nicely rendered markdown file, I can run: + +```bash +$ glow README.md +``` + +For long markdown files like [this `README.md`](https://github.com/jbranchaud/til/blob/master/README.md), this +doesn't work too well because it renders until the end and spits you at at the +bottom. + +Fortunately, `glow` has a built-in pager that maintains all the styling while +allowing you to navigate and search similar to `less`. + +```bash +$ glow -p README.md +``` + +There is also a TUI version (`-t`), but I find that less intuitive and useful +than the pager. + +See `glow --help` for more details.