obsidian/canvas
Contains a utility function for extracting references from a canvas (.canvas) file.
Functions
Section titled “Functions”| Function | Description |
|---|---|
| getCanvasReferences | Extracts the outgoing references of a canvas (.canvas) file. Obsidian does not index canvas links into the per-file metadata cache, so a canvas file’s CachedMetadata is empty and the usual cache-based readers return nothing for it. This helper reads the canvas JSON directly and returns both its file-node links and its text-node embeds as CanvasReferences. The returned references carry the nodeIndex/type (and, for text nodes, the originalReference) that the canvas-aware write path needs, so a consumer can move a canvas-referenced attachment and rewrite the canvas by composing referenceToFileChange (from ./reference.ts) with applyFileChanges (from ./file-change.ts). |