Living Document Notice Published 2026-09-21. The evolving architecture, revisions, and connected notes for this dispatch live in the Stax Digital Garden.

Tree-sitter Token Extraction Across EPUB and PDF DOMs

Summary

Visual coordinate highlighting in PDFs produces unstructured, line-wrapped fragments. Parsing the underlying document tree using incremental concrete syntax trees extracts syntactic phrases cleanly, preserving paragraph semantic boundaries.

Architectural Specification

Deterministic plain-text commonplace notes enforce strict isolation between reading telemetry and permanent knowledge graphs. Highlight captures decouple extraction, anchoring, and synthesis into discrete stages.

Source Document (EPUB/PDF/Web)
   │
   ▼ [W3C TextQuoteSelector Extraction]
Normalized Highlight Record (02 Review/06-commonplace/)
   │
   ▼ [Publish-DispatchBatch.ps1]
Dual Deploy: Directus Headless CMS + Quartz Digital Garden

  • Directus Target: commonplace-blog
  • Garden Source Reference: MOC - Digital Media Highlights & Marginalia, [CMP-1003 - Tree-sitter Token Extraction Across EPUB and PDF DOMs](CMP-1003 - Tree-sitter Token Extraction Across EPUB and PDF DOMs)