HN
Today

Blogging with Gleam, Org-Mode and Pandoc

This post dives deep into a highly opinionated, yet meticulously crafted, blogging setup combining Emacs, Org-mode, Pandoc, Gleam, and Nix. It champions a 'literate programming' approach, arguing for the coherence of Emacs and Org-mode over disparate tools and justifying the use of advanced, type-checked systems for static site generation.

13
Score
1
Comments
#12
Highest Rank
3h
on Front Page
First Seen
Oct 2, 7:00 PM
Last Seen
Oct 2, 9:00 PM
Rank Over Time
121417

The Lowdown

The author introduces the first post for "Byzantine Systems" with an almost fanatical enthusiasm for a new method of composing programs, drawing inspiration from Donald Knuth's concept of literate programming. This new setup prioritizes writing within Emacs using Org-mode, while making the publishing pipeline smaller, typed, and easier to understand.

  • Toolchain Overview: The system leverages Org-mode as the source format, d2 for declarative diagrams, Babel for Org-mode extensions, Pandoc for robust conversion, Nix/flakes/devenv for reproducible build environments, Gleam and Blogatto for a typed static-site pipeline, and Lustre for HTML templating without a separate language.
  • Justification for 'Overkill': Despite appearing complex for a simple static page, the author demonstrates how a type-checked Gleam function handles the post index, highlighting the benefits of this approach.
  • Emacs as the Core: The author strongly advocates for keeping everything within Emacs, defining it as 'good bloat' due to its consistent, unified environment, which avoids the 'userland bloat' of managing many inconsistent UNIX tools.
  • Org-mode vs. Markdown: Org-mode is presented as a far superior format to Markdown, offering rich features for mixing computational and natural languages, interactive source blocks, and a coherent system, unlike the fragmented extensions often needed for Markdown.
  • Pandoc's Role: Pandoc serves as a crucial boundary, converting Org documents to GitHub Flavored Markdown for consumption by Blogatto, handling citations and leveraging small Lua filters for specific conversions.
  • Gleam, Blogatto, and Lustre: These tools provide a type-checked framework for generating the static site, building pages, RSS feeds, and copying assets after Pandoc's conversion.
  • Nix for Reproducibility: Nix ensures a reproducible development environment, pinning dependencies and making the build process consistently uneventful with nix develop and make run.

The author concludes that while the number of tools might seem absurd for a static site, each serves a narrow, well-defined purpose. Emacs remains the central hub, providing a cohesive environment for writing, structuring, and computing, with Org-mode as the superior interactive document model.