PreviewMD for Mac, iPad & iPhone
Get

What PreviewMD renders, and what renders it

Every renderer below ships inside the app. Nothing is fetched while a document is drawn, no CDN is contacted, no telemetry leaves the device — which is why Quick Look appears instantly and why all of this works on a plane.

This page is rendered by the same stack. Switch to Source at the top to see the Markdown behind any example on it.

The modules

Module Version What it does
markdown-it 14.1.0 The parser: CommonMark, plus the GitHub extensions below
KaTeX 0.16.22 Maths, typeset rather than pictured
Mermaid 11.16.1 Diagrams drawn from text
highlight.js 11.11.1 Syntax highlighting, almost two hundred languages
@vscode/markdown-it-katex 1.1.2 Finds $…$ and $$…$$ in the text and hands them to KaTeX
markdown-it-task-lists 2.1.0 - [x] checkboxes
markdown-it-footnote 4.0.0 Footnotes and their back-links
markdown-it-emoji 2.0.2 :shortcodes:
markdown-it-front-matter 0.2.4 YAML front matter, hidden rather than printed
jsdiff + diff2html — The Diff view and its word-level highlighting
github-markdown-css — The page style, light and dark

Each one carries its own licence notice, reproduced verbatim in the app under Help ▸ Acknowledgements.

Maths

KaTeX typesets formulas, so they scale, select and copy as text instead of arriving as a blurry image. Inline maths goes between single dollars — the speed at any point on an orbit is v=μ(2/r−1/a)v = \sqrt{\mu(2/r - 1/a)} — and a formula on its own line goes between double dollars:

Δv=μr1(2r2r1+r2−1)\Delta v = \sqrt{\frac{\mu}{r_1}}\left(\sqrt{\frac{2r_2}{r_1+r_2}} - 1\right)

Matrices, sums and aligned equations work the same way:

A=(abcd)∑n=1∞1n2=π26A = \begin{pmatrix} a & b \\ c & d \end{pmatrix} \qquad \sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}

Diagrams

A fenced block marked mermaid becomes a drawing. The text stays the source of truth: edit a line, the picture changes, and the file is still a text file your version control can diff.

graph LR
  A[Write] --> B[Preview]
  B --> C{Looks right?}
  C -- yes --> D[Export]
  C -- no --> A

Sequence diagrams, for anything with a back and forth:

sequenceDiagram
  participant F as Finder
  participant Q as Quick Look
  participant P as PreviewMD
  F->>Q: spacebar on README.md
  Q->>P: render this file
  P-->>Q: the rendered page
  Q-->>F: shown, no app launched

And proportions, where a table would make you do the arithmetic yourself:

pie showData
  title What a README is made of
  "Prose" : 55
  "Code blocks" : 30
  "Tables" : 10
  "Diagrams" : 5

State and class diagrams, gantt charts and the rest of Mermaid’s repertoire render the same way.

Code

Fenced blocks are highlighted by highlight.js, which knows almost two hundred languages. The language goes after the opening fence:

struct Entry: Comparable {
    let clock: UInt64
    let device: UUID

    static func < (a: Entry, b: Entry) -> Bool {
        // Ties break on device id so the order is the same everywhere.
        (a.clock, a.device.uuidString) < (b.clock, b.device.uuidString)
    }
}
def hohmann(r1: float, r2: float, mu: float = 3.986e14) -> float:
    """Total delta-v for a transfer between circular orbits."""
    first = (mu / r1) ** 0.5 * ((2 * r2 / (r1 + r2)) ** 0.5 - 1)
    second = (mu / r2) ** 0.5 * (1 - (2 * r1 / (r1 + r2)) ** 0.5)
    return first + second

A block with no language is left as plain monospaced text, and inline code needs no language at all.

The GitHub extensions

What GitHub added to Markdown, and what a README therefore assumes:

  • Task lists, with the boxes drawn
  • Including the ones still open
  • Strikethrough for what no longer applies
  • Footnotes[1], numbered and linked back
  • Autolinks: https://previewmd.xfanta.com turns into a link on its own
  • Emoji by shortcode: 🚀 ✨ ✅

Note

Alert callouts are GitHub’s own convention, not part of any Markdown specification — a blockquote whose first line names the kind.

Warning

There are five: Note, Tip, Important, Warning and Caution.


  1. Which land at the bottom of the document, with an arrow back to where you were reading. ↩︎

The quieter ones

Front matter. A YAML block at the very top of a file, between --- lines, is metadata for a static site generator — not something you meant to read. It is parsed and hidden rather than printed as a table of gibberish.

Images. Local images referenced by a document are shown, loaded from the folder the document sits in. Nothing is fetched over the network, so a document with a broken path says so instead of hanging.

Tables. Ordinary GFM pipe tables, with alignment taken from the colons in the separator row. Wide ones scroll rather than breaking the page.

Reading all of this on your Mac

PreviewMD renders everything on this page in Quick Look, in its own window, and in exported HTML and PDF — on Mac, iPad and iPhone, free.

The cheat sheet lists every mark with its result, and what Markdown is covers where the format came from.