# mghurryo/ink-notes architecture

> Architecture diagram of the GitHub repository mghurryo/ink-notes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mghurryo/ink-notes
- Repository: https://github.com/mghurryo/ink-notes

## Overview

Ink Notes is an Obsidian plugin for handwriting notebooks and PDF annotation, with vault-backed storage and shared editing tools. Users open or create a notebook, or open a PDF in a separate handwriting view; they edit pages and can export annotated PDFs while preserving the source. The map includes the documented image, sticky-note, lasso, and page-organization capabilities. Some links reflect README workflows; sampled excerpts and the source index support the internal module relationships shown, but not every runtime dispatch was visible.

Main entry points: [`src/view.ts`](https://github.com/mghurryo/ink-notes/blob/master/src/view.ts) (Notebook view), [`src/pdf-view.ts`](https://github.com/mghurryo/ink-notes/blob/master/src/pdf-view.ts) (PDF handwriting view), [`src/main.ts`](https://github.com/mghurryo/ink-notes/blob/master/src/main.ts) (Plugin commands), [`src/ink-writing.ts`](https://github.com/mghurryo/ink-notes/blob/master/src/ink-writing.ts) (Shared ink editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Plugin and navigation"]
  node_plugin["Plugin commands<br/>[main.ts]"]
  node_notebook["Notebook view<br/>[view.ts]"]
  node_picker["Notebook picker<br/>[notebook-modal.ts]"]
end

subgraph group_editing["Writing and editing"]
  node_writing["Shared ink editor<br/>[ink-writing.ts]"]
  node_tools["Tool controls<br/>[tool-state.ts]"]
  node_brush["Brush settings<br/>[brush-popover.ts]"]
  node_lasso["Lasso clipboard<br/>[lasso-clipboard.ts]"]
end

subgraph group_content["Notebook content"]
  node_images["Image library<br/>[image-library.ts]"]
  node_stickies["Sticky notes<br/>[sticky-notes.ts]"]
  node_tags["Page tags<br/>[page-tags.ts]"]
  node_model["Notebook model<br/>[model.ts]"]
  node_sticky_model["Sticky data model<br/>[sticky-model.ts]"]
  node_sticky_render["Sticky rendering"]
end

subgraph group_pdf["PDF annotation"]
  node_pdfview["PDF handwriting view<br/>[pdf-view.ts]"]
  node_takeover["PDF viewer selection<br/>[pdf-takeover.ts]"]
  node_sidecar["PDF sidecar model<br/>[pdf-sidecar.ts]"]
  node_pdfstore[("PDF sidecar storage<br/>[pdf-store.ts]")]
  node_export["PDF export<br/>[pdf-export.ts]"]
end

subgraph group_runtime["Storage and rendering"]
  node_storage[("Vault notebook storage<br/>[storage.ts]")]
  node_codec["Storage codec<br/>[storage-codec.ts]"]
  node_rendering["Ink rendering<br/>[rendering.ts]"]
  node_tiles["Tiled rendering<br/>[tiles.ts]"]
  node_worker["Background worker service<br/>[worker-service.ts]"]
  node_protocol["Worker protocol<br/>[worker-protocol.ts]"]
end

node_user(("Obsidian user"))

node_user -->|"opens commands"| node_plugin
node_plugin -->|"opens picker"| node_picker
node_plugin -->|"opens notebook"| node_notebook
node_user -->|"opens PDF notes"| node_pdfview
node_plugin -->|"selects viewer"| node_takeover
node_notebook -->|"uses editor"| node_writing
node_pdfview -->|"uses editor"| node_writing
node_writing -->|"edits notebook"| node_model
node_notebook -->|"reads and saves"| node_storage
node_storage -->|"encodes data"| node_codec
node_storage -->|"normalizes and merges"| node_model
node_notebook -->|"configures tools"| node_tools
node_tools -->|"uses settings"| node_brush
node_writing -->|"renders ink"| node_tiles
node_tiles -->|"draws strokes"| node_rendering
node_notebook -->|"manages images"| node_images
node_notebook -->|"organizes pages"| node_tags
node_notebook -->|"renders stickies"| node_sticky_render
node_sticky_render -->|"renders data"| node_sticky_model
node_pdfview -->|"normalizes notes"| node_sidecar
node_pdfview -->|"reads and saves"| node_pdfstore
node_pdfstore -->|"uses sidecar model"| node_sidecar
node_pdfview -->|"exports annotations"| node_export
node_notebook -->|"exports notebook"| node_export
node_notebook -->|"uses background work"| node_worker
node_pdfview -->|"uses background work"| node_worker
node_worker -->|"exchanges messages"| node_protocol
node_protocol -->|"serializes notebooks"| node_codec
node_plugin -->|"registers PDF view"| node_pdfview
node_notebook -->|"offers clipboard actions"| node_lasso

click node_plugin "https://github.com/mghurryo/ink-notes/blob/master/src/main.ts"
click node_notebook "https://github.com/mghurryo/ink-notes/blob/master/src/view.ts"
click node_picker "https://github.com/mghurryo/ink-notes/blob/master/src/notebook-modal.ts"
click node_pdfview "https://github.com/mghurryo/ink-notes/blob/master/src/pdf-view.ts"
click node_takeover "https://github.com/mghurryo/ink-notes/blob/master/src/pdf-takeover.ts"
click node_writing "https://github.com/mghurryo/ink-notes/blob/master/src/ink-writing.ts"
click node_tools "https://github.com/mghurryo/ink-notes/blob/master/src/tool-state.ts"
click node_brush "https://github.com/mghurryo/ink-notes/blob/master/src/brush-popover.ts"
click node_lasso "https://github.com/mghurryo/ink-notes/blob/master/src/lasso-clipboard.ts"
click node_images "https://github.com/mghurryo/ink-notes/blob/master/src/image-library.ts"
click node_stickies "https://github.com/mghurryo/ink-notes/blob/master/src/sticky-notes.ts"
click node_tags "https://github.com/mghurryo/ink-notes/blob/master/src/page-tags.ts"
click node_model "https://github.com/mghurryo/ink-notes/blob/master/src/model.ts"
click node_sticky_model "https://github.com/mghurryo/ink-notes/blob/master/src/sticky-model.ts"
click node_storage "https://github.com/mghurryo/ink-notes/blob/master/src/storage.ts"
click node_codec "https://github.com/mghurryo/ink-notes/blob/master/src/storage-codec.ts"
click node_rendering "https://github.com/mghurryo/ink-notes/blob/master/src/rendering.ts"
click node_tiles "https://github.com/mghurryo/ink-notes/blob/master/src/tiles.ts"
click node_worker "https://github.com/mghurryo/ink-notes/blob/master/src/worker-service.ts"
click node_protocol "https://github.com/mghurryo/ink-notes/blob/master/src/worker-protocol.ts"
click node_sidecar "https://github.com/mghurryo/ink-notes/blob/master/src/pdf-sidecar.ts"
click node_pdfstore "https://github.com/mghurryo/ink-notes/blob/master/src/pdf-store.ts"
click node_export "https://github.com/mghurryo/ink-notes/blob/master/src/pdf-export.ts"
click node_sticky_render "https://github.com/mghurryo/ink-notes/blob/master/src/sticky-rendering.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin,node_notebook,node_picker,node_user toneBlue
class node_writing,node_tools,node_brush,node_lasso toneAmber
class node_images,node_stickies,node_tags,node_model,node_sticky_model,node_sticky_render toneMint
class node_pdfview,node_takeover,node_sidecar,node_pdfstore,node_export toneRose
class node_storage,node_codec,node_rendering,node_tiles,node_worker,node_protocol toneIndigo
```

## Components

### Plugin and navigation

- [Plugin commands](https://github.com/mghurryo/ink-notes/blob/master/src/main.ts): `src/main.ts`
- [Notebook view](https://github.com/mghurryo/ink-notes/blob/master/src/view.ts): `src/view.ts`
- [Notebook picker](https://github.com/mghurryo/ink-notes/blob/master/src/notebook-modal.ts): `src/notebook-modal.ts`

### Writing and editing

- [Shared ink editor](https://github.com/mghurryo/ink-notes/blob/master/src/ink-writing.ts): `src/ink-writing.ts`
- [Tool controls](https://github.com/mghurryo/ink-notes/blob/master/src/tool-state.ts): `src/tool-state.ts`
- [Brush settings](https://github.com/mghurryo/ink-notes/blob/master/src/brush-popover.ts): `src/brush-popover.ts`
- [Lasso clipboard](https://github.com/mghurryo/ink-notes/blob/master/src/lasso-clipboard.ts): `src/lasso-clipboard.ts`

### Notebook content

- [Image library](https://github.com/mghurryo/ink-notes/blob/master/src/image-library.ts): `src/image-library.ts`
- [Sticky notes](https://github.com/mghurryo/ink-notes/blob/master/src/sticky-notes.ts): `src/sticky-notes.ts`
- [Page tags](https://github.com/mghurryo/ink-notes/blob/master/src/page-tags.ts): `src/page-tags.ts`
- [Notebook model](https://github.com/mghurryo/ink-notes/blob/master/src/model.ts): `src/model.ts`
- [Sticky data model](https://github.com/mghurryo/ink-notes/blob/master/src/sticky-model.ts): `src/sticky-model.ts`
- [Sticky rendering](https://github.com/mghurryo/ink-notes/blob/master/src/sticky-rendering.ts): `src/sticky-rendering.ts`

### PDF annotation

- [PDF handwriting view](https://github.com/mghurryo/ink-notes/blob/master/src/pdf-view.ts): `src/pdf-view.ts`
- [PDF viewer selection](https://github.com/mghurryo/ink-notes/blob/master/src/pdf-takeover.ts): `src/pdf-takeover.ts`
- [PDF sidecar model](https://github.com/mghurryo/ink-notes/blob/master/src/pdf-sidecar.ts): `src/pdf-sidecar.ts`
- [PDF sidecar storage](https://github.com/mghurryo/ink-notes/blob/master/src/pdf-store.ts): `src/pdf-store.ts`
- [PDF export](https://github.com/mghurryo/ink-notes/blob/master/src/pdf-export.ts): `src/pdf-export.ts`

### Storage and rendering

- [Vault notebook storage](https://github.com/mghurryo/ink-notes/blob/master/src/storage.ts): `src/storage.ts`
- [Storage codec](https://github.com/mghurryo/ink-notes/blob/master/src/storage-codec.ts): `src/storage-codec.ts`
- [Ink rendering](https://github.com/mghurryo/ink-notes/blob/master/src/rendering.ts): `src/rendering.ts`
- [Tiled rendering](https://github.com/mghurryo/ink-notes/blob/master/src/tiles.ts): `src/tiles.ts`
- [Background worker service](https://github.com/mghurryo/ink-notes/blob/master/src/worker-service.ts): `src/worker-service.ts`
- [Worker protocol](https://github.com/mghurryo/ink-notes/blob/master/src/worker-protocol.ts): `src/worker-protocol.ts`

### Other components

- **Obsidian user**

## Connections

- Obsidian user → Plugin commands: opens commands (evidence: `README.md`)
- Plugin commands → Notebook picker: opens picker (evidence: `README.md`)
- Plugin commands → Notebook view: opens notebook (evidence: `README.md`)
- Obsidian user → PDF handwriting view: opens PDF notes (evidence: `README.md`)
- Plugin commands → PDF viewer selection: selects viewer (evidence: `README.md`)
- Notebook view → Shared ink editor: uses editor (evidence: `src/view.ts`)
- PDF handwriting view → Shared ink editor: uses editor (evidence: `src/pdf-view.ts`)
- Shared ink editor → Notebook model: edits notebook (evidence: `src/ink-writing.ts`)
- Notebook view → Vault notebook storage: reads and saves (evidence: `src/view.ts`)
- Vault notebook storage → Storage codec: encodes data (evidence: `src/storage.ts`)
- Vault notebook storage → Notebook model: normalizes and merges (evidence: `src/storage.ts`)
- Notebook view → Tool controls: configures tools (evidence: `src/view.ts`)
- Tool controls → Brush settings: uses settings (evidence: `src/tool-state.ts`)
- Shared ink editor → Tiled rendering: renders ink (evidence: `src/ink-writing.ts`)
- Tiled rendering → Ink rendering: draws strokes (evidence: `src/tiles.ts`)
- Notebook view → Image library: manages images (evidence: `src/view.ts`)
- Notebook view → Page tags: organizes pages (evidence: `src/view.ts`)
- Notebook view → Sticky rendering: renders stickies (evidence: `src/view.ts`)
- Sticky rendering → Sticky data model: renders data
- PDF handwriting view → PDF sidecar model: normalizes notes (evidence: `src/pdf-view.ts`)
- PDF handwriting view → PDF sidecar storage: reads and saves (evidence: `src/pdf-view.ts`)
- PDF sidecar storage → PDF sidecar model: uses sidecar model (evidence: `src/pdf-store.ts`)
- PDF handwriting view → PDF export: exports annotations (evidence: `src/pdf-view.ts`)
- Notebook view → PDF export: exports notebook (evidence: `src/view.ts`)
- Notebook view → Background worker service: uses background work (evidence: `src/view.ts`)
- PDF handwriting view → Background worker service: uses background work (evidence: `src/pdf-view.ts`)
- Background worker service → Worker protocol: exchanges messages (evidence: `src/worker-service.ts`)
- Worker protocol → Storage codec: serializes notebooks (evidence: `src/worker-protocol.ts`)
- Plugin commands → PDF handwriting view: registers PDF view (evidence: `src/main.ts`)
- Notebook view → Lasso clipboard: offers clipboard actions (evidence: `src/view.ts`)
