@chaoticgoodcomputing/quartz-annotator
v0.1.0
Published
Quartz 5 plugin that shows annotations written with Obsidian's Annotator plugin, and mirrors their source documents. See CONTEXT.md and docs/adr/.
Readme
title: Quartz Annotator tags:
- writing/highlights
- projects/site/plugins
- writing/annotations
- engineering/languages/typescript
- engineering/frontend date: 2026-09-27 description: How to install Quartz Annotator, a plugin for displaying highlights and annotations of PDF documents
Publishes notes written with Obsidian's Annotator plugin as annotation pages: the source PDF, with each annotated passage highlighted, beside the annotations.
![[assets/Pasted image 20260927191003.png]]
Screencap of [[content/annotations/valve-handbook|"Working with Valves"]]
A note becomes an annotation page when its frontmatter names the document it annotates:
---
title: 'Working with Valves: Understanding the Structure of "Flat" Organizations'
annotation-target: https://media.steampowered.com/apps/valve/Valve_Handbook_LowRes.pdf
---At build time the plugin fetches each target PDF once and serves its own copy, a mirror, so the viewer can read it. A document that can't be fetched never fails the build: the page shows the annotations with a link to the source instead.
Installation
npm install @chaoticgoodcomputing/quartz-annotatorRequires [[/plugins/quartz-styles|Quartz Styles]].
Usage
plugins:
- source: "@chaoticgoodcomputing/quartz-annotator"
enabled: true
options:
mirrorDir: mirrors- Keep
cacheDirbetween builds, in CI too. A mirror is pinned on first fetch, since annotations are anchored to that exact file; delete it from the cache to refresh it. - Add
Disallow: /mirrors/(or yourmirrorDir) torobots.txt, so search engines don't index other people's documents as your content. - Annotation pages use the layout key
annotationunderlayout.byPageType, and the plugin's own frame,cgc-annotation: theheaderandleftcomponents go in a ☰ drawer,beforeBodyabove the document, andrightandafterBodyafter it. Exclude there what you don't want on these pages. - Write around your annotations with H1 markers: prose under
# Preface(or before any marker) shows above the document, prose under# Epilogueafter it. Keep# Annotationslast, where Annotator appends new ones.
On a wide screen the annotations sit in the document's margin, each beside its passage; on a narrower one, or zoomed in, they come out of a drawer from the right. Readers can zoom the document from the bar, or pinch it.
Configuration
| Option | Type | Default | Description |
| -------------- | ---------- | ----------------------------------- | ----------------------------------------------------------------------------------------- |
| mirrorDir | string | "mirrors" | Where mirrors are served from, relative to the site root. |
| cacheDir | string | node_modules/.cache/cgc-annotator | Where mirrors are pinned between builds, relative to the Quartz root or absolute. |
| fetchTimeout | number | 60000 | Milliseconds to wait for a source document before building without it. |
| denylist | string[] | whole-page transformers | Transformers that annotation notes are rendered without. Setting it replaces the default. |
| marginWidth | string | "20rem" | A card's width, in the desktop margin and the tablet drawer. px or rem. |
| minDocumentWidth | string | "36rem" | The narrowest the document may be at 100% beside the margin. px or rem. |
| textWidth | string | "800px" | The width of the sections above and below the document. px or rem. |
