๐Ÿ“ฆ Stack & Dependencies

  • ๐Ÿš€ Runtimes: Requires Node.js v22+ and npm v10.9.2+ for core ESM and plugin API support.
  • โš™๏ธ Core Ecosystem: Relies on unified, remark, and rehype for AST manipulation.
  • ๐ŸŽจ Canvas Integration: Uses @quartz-community/canvas-page for native JSON Canvas Spec 1.0 support.

๐Ÿ—๏ธ Plugin Pipeline Stages

๐Ÿ”Œ Category๐ŸŽฏ Purpose๐Ÿ› ๏ธ Key Built-in Examples
๐Ÿ”„ TransformersParse & alter AST (Markdown syntax, frontmatter, links).ObsidianFlavoredMarkdown, CrawlLinks
๐Ÿงน FiltersPrune content (exclude drafts and non-published files).Drafts, ExplicitPublish
๐Ÿ“ค EmittersCompile & write static assets, search indices, and graphs.Pagefind, GraphView, Static

๐Ÿ’ก Best Practices

  • โœจ HAST Shallow-cloning: Utilize Object.assign({}, node) during AST transformations. This avoids the severe memory overhead of deep cloning massive unified/rehype trees.
  • โœจ Native Canvas Rendering: Drop raw .canvas files directly into your content directory. The Quartz integration natively handles interactive panning and zooming.
  • โœจ Concurrent Emitters: Design all custom emitters as pure functions without shared mutable state. Concurrent pipeline execution drastically reduces build times (see 01-Configuration for pipeline setup).

๐Ÿšจ Gotchas & Warnings

  • โš ๏ธ Deep Cloning AST: NEVER deep clone HAST trees during transformation passes. This neutralizes optimizations and causes extreme memory bloat.
  • โš ๏ธ Mutating Shared HAST Children: Do not mutate nested node.children directly if the node was only shallow-cloned. Always create a new children array for structural changes.
  • โš ๏ธ Canvas Manual Export: DO NOT manually export Obsidian Canvases to PNG, PDF, or raw HTML. It creates stale data silos and breaks the SSOT architecture.
  • โš ๏ธ Blocking Emitters: AVOID heavy synchronous fs operations in emitters. Blocking the Node.js event loop destroys concurrent pipeline throughput.