graphite.md logo
graphite.md
A richer Markdown preview for VS Code
Install GitHub Issues
v0.0.2

graphite.md

A Markdown preview for people who read a lot of Markdown: collapsible sections, a git-graph style outline, checklists, math, and diagrams — in a dark, distraction-free theme.

Features

Collapsible sections

Every heading in your document collapses and expands independently. Long specs and READMEs stop being one giant scroll.

A git-graph outline

The right-hand "On this page" pane shows your document's structure as a connected graph — not a flat list — split into three views:

Only one view is open at a time. Click any node to soft-scroll to that part of the document; the outline highlights where you are as you scroll.

Checklists

Write - [ ] and - [x] as usual. In the preview they render as real, clickable checkboxes — checking one off edits your markdown file directly, so your task list and your document never drift apart.

Math

Inline ($...$) and block ($$...$$) math, rendered with KaTeX.

Diagrams

Fenced ```mermaid code blocks render as live diagrams.

Callouts

Blockquotes (>) get a distinct treatment so notes and asides stand out from body text.

Rich inline syntax

Superscript (^2^), subscript (~2~), underline (++text++), highlighting (==text==), strikethrough (~~text~~), and footnotes ([^1]) all render natively.

Links that go where you meant them to

A relative link opens the file it points at, resolved against the document you're previewing — the same way VS Code's own Markdown preview resolves it. Absolute URLs open in your browser. And a bare filename stays a filename: README.md in a sentence is not turned into a link to http://README.md, which matters because plenty of country domains (.md, .sh, .rs, .pl, .so, .cc) are also file extensions.

Syntax highlighting

Fenced code blocks are highlighted with highlight.js, tinted to match the graphite theme.

Tunable reading width

Set it once in settings.json — the preview picks the new width up immediately, no reload:

{
  "graphiteMd.contentWidth": 60
}

Usage

  1. Open a .md file.
  2. Run graphite.md: Open Preview to the Side from the Command Palette, or press Ctrl+K V (Cmd+K V on macOS).
  3. The preview updates live as you type.

Settings

SettingTypeDefaultDescription
graphiteMd.contentWidthnumber (40–100)60Width of the reading column, as a percentage of the available preview pane width.

Requirements

VS Code 1.134.0 or later. No other setup — everything the preview needs (KaTeX, Mermaid) ships bundled with the extension.

Known limitations

Contributing

Build instructions and an overview of how the extension is put together are in DEVELOPMENT.md. Bug reports and pull requests are welcome on GitHub.

License

MIT

Documentation

A closer look at how to use each part of the preview.

Opening the preview

With a Markdown file open, run one of these from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

The preview re-renders automatically as you edit — no manual refresh.

Collapsing sections

Click any heading (or its chevron, hanging in the left margin) to collapse everything under it. Click again to reopen. This only affects what's shown in the reading pane — it doesn't touch your source file.

The "On this page" outline

Three collapsible groups on the right, at most one open at a time:

Clicking any node soft-scrolls the reading pane to that spot, opens any collapsed parent sections needed to reveal it (siblings stay untouched), and briefly pulses the node so you can confirm where you landed.

Setup Install Requirements Node Version Configure Usage
Depth nests by curving right; siblings hang off a shared vertical run. The path to the section you're reading is drawn in the accent colour as you scroll.

Checklists

Write these like any GitHub-flavored checklist:

- [ ] Not done yet
- [x] Done

They render as clickable boxes:

Clicking a box edits the underlying [ ] / [x] in your markdown file directly — the preview never holds state your file doesn't also have.

Math

Inline math sits in a line of text: $w = c + 2p + 2b$. Block math stands alone:

$$
\text{width} = \text{content} + 2\times\text{padding} + 2\times\text{border}
$$

Diagrams

Fence a Mermaid diagram like any code block, just with mermaid as the language:

```mermaid
graph TD
  A[Start] --> B{Decision}
  B -->|Yes| C[Do this]
  B -->|No| D[Do that]
```

Callouts

A normal blockquote:

> Percentages resolve against the parent's content box.

renders as:

Percentages resolve against the parent's content box.

Rich inline syntax

Beyond the usual emphasis, these all render natively:

WriteGet
^2^superscript
~2~subscript
++text++underlined text
==text==highlighted text
~~text~~strikethrough
[^1]a footnote reference

Footnotes collect at the bottom of the preview as a numbered list. Clicking a reference jumps to its note, and the ↩︎ beside the note brings you back to where you were reading.

Water is H~2~O, and E = mc^2^.

Here's a claim that needs a source.[^1]

[^1]: And here's the source.

Code blocks

Fenced code is highlighted with highlight.js, using the language you name after the backticks:

```ts
const answer: number = 42;
```

An unknown or missing language falls back to plain monospace rather than failing.

Reading width

Set the reading column width once in settings.json:

{
  "graphiteMd.contentWidth": 60
}

A percentage of the available pane (40–100). Changing the setting updates an already-open preview immediately — there's no in-panel control.

Keyboard shortcuts

ActionWindows / LinuxmacOS
Open preview to the sideCtrl+K VCmd+K V