AiSlackin
Entry
025 / 028
Filed
2026.11.12
Reading
2 min

[ mdview ]

a Markdown reader that minds its own business

A distraction-free Markdown viewer for Linux built on GTK 4, WebKitGTK and md4c. No editor, no telemetry, no scripts from your documents — just reading.

mdview: a Markdown reader that minds its own business
Fig. 00 / mdviewHover to pull the color proof

I keep a lot of Markdown around — notes, docs, READMEs half-written — and every tool I tried wanted to be an editor first and a reader second. mdview is the opposite: a standalone viewer for Linux that renders Markdown and otherwise leaves you alone. No save. No write-back. No text input into the document. That restraint is the feature.

What it is, honestly

  • A reader for .md files with a sidebar that lists the current folder and a live outline of the document
  • GitHub-flavored Markdown: tables, task lists, strikethrough, footnotes
  • Relative images resolve against the Markdown file’s own folder, so READMEs render right
  • Links between Markdown files open rendered, inside the viewer; external links hand off to your browser
  • Light / dark / system theme, find-in-page, zoom, fullscreen, drag-and-drop
  • A headless --render mode: mdview --render input.md output.html writes a self-contained HTML document with no display required — handy for static export and scripted checks

The part I care about

Documents are treated as untrusted. The web view sets enable-javascript-markup to false, so a <script> buried in a Markdown file’s raw HTML does not run. Raw HTML still reaches the page, but it’s inert. There’s even a probe test (make probe) that re-verifies this against a WebKitGTK upgrade instead of trusting the source alone — a config that can drift silently got a way to prove itself, which is more than most apps do.

How it works mechanically

It’s plain C on three libraries: GTK 4 for the window, WebKitGTK 6.0 for rendering, md4c for Markdown-to-HTML. The renderer (src/render.c) deliberately has zero GUI dependencies — that’s what makes --render and the test suite headless. make check runs two suites that pin the behavior: outline_test with nine heading-extraction cases (fenced code, setext, escapes) and render_test over the HTML output (doctype, tables, task checkboxes, footnotes, embedded stylesheet).

Where to get it

text
git clone https://github.com/rahlquist/mdview
cd mdview && make && make install    # user-local, no sudo needed

Dependencies are gtk4, webkitgtk-6.0 (or libwebkitgtk-6.0-dev on Debian/Ubuntu), md4c. MIT licensed. Arch is the primary target; the rest just need equivalent packages.

Known limits stated plainly: no syntax highlighting in code blocks, the outline only covers ATX headings, and it’s one document at a time. It’s a reader. That’s the whole idea.

End of entry 025

>
↑ ↓ moveEnter open/ opens search anywhere