No description
Find a file
rmoff ad781f9c9d Bump typescript devDep to 4.9.5
The eslint-plugin-obsidianmd dependency tree (via
@typescript-eslint/parser ^8) requires typescript >=4.8.4, so the
previous 4.7.4 pin caused `npm install` to fail in CI without
--legacy-peer-deps. Bumping to 4.9.5 (still 4.x, no API changes)
restores a clean install.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 11:17:08 +01:00
.github/workflows Address scorecard findings, fix existence check, bump to 1.0.1 2026-05-13 14:34:08 +01:00
src Fix scorecard warnings and add local eslint setup 2026-05-14 10:44:11 +01:00
.gitignore Initial commit: Obsidian Canvas Export plugin 2026-04-15 11:59:39 +01:00
CONTRIBUTING.md Add CONTRIBUTING.md and bump to 1.0.2 2026-05-14 10:46:02 +01:00
esbuild.config.mjs Address scorecard findings, fix existence check, bump to 1.0.1 2026-05-13 14:34:08 +01:00
eslint.config.mjs Fix scorecard warnings and add local eslint setup 2026-05-14 10:44:11 +01:00
LICENSE Initial commit: Obsidian Canvas Export plugin 2026-04-15 11:59:39 +01:00
main.ts Fix scorecard warnings and add local eslint setup 2026-05-14 10:44:11 +01:00
manifest.json Add CONTRIBUTING.md and bump to 1.0.2 2026-05-14 10:46:02 +01:00
package-lock.json Bump typescript devDep to 4.9.5 2026-05-14 11:17:08 +01:00
package.json Bump typescript devDep to 4.9.5 2026-05-14 11:17:08 +01:00
README.md Add author credit to README 2026-04-15 12:06:34 +01:00
styles.css Fix linting issues from obsidian-releases review 2026-04-16 09:29:33 +01:00
tsconfig.json Initial commit: Obsidian Canvas Export plugin 2026-04-15 11:59:39 +01:00
versions.json Add CONTRIBUTING.md and bump to 1.0.2 2026-05-14 10:46:02 +01:00

Canvas Export

An Obsidian plugin that exports .canvas files to multiple formats:

  • HTML (light and dark themes) — fully self-contained, clickable links
  • Excalidraw (.excalidraw) — editable diagrams
  • Mermaid (.mmd) — text-based flowcharts
  • D2 (.d2) — declarative diagrams
  • PDF — print-ready via Electron

Usage

Open a .canvas file, then use the Command Palette (Cmd/Ctrl+P):

  • Canvas Export: Export to HTML (light)
  • Canvas Export: Export to HTML (dark)
  • Canvas Export: Export to Excalidraw
  • Canvas Export: Export to Mermaid (.mmd)
  • Canvas Export: Export to D2 (.d2)
  • Canvas Export: Export to PDF
  • Canvas Export: Export current canvas... — multi-format picker modal
  • Canvas Export: Re-export with last settings

You can also right-click a .canvas file in the file explorer and select Export Canvas....

If the output file already exists, you'll be prompted to overwrite, save with a numbered name, or skip.

What gets exported

Canvas files follow the JSON Canvas spec and can contain four types of nodes: text, groups, file embeds, and link embeds. Not all of these translate equally to every format.

All formats

Feature How it's handled
Text nodes Exported with basic Markdown rendering (headings, bold, italic, links, lists)
Groups Rendered as containers with labels
Edges (arrows) Preserved with correct anchoring and direction
Node colors Mapped to each format's color system (Obsidian's 6 preset colors + custom hex)
YAML frontmatter in text nodes Stripped automatically (used by plugins like Canvas Candy)
Images / file embeds Shown as a placeholder with the filename (e.g. 📄 diagram.png) — images are not embedded
Link embeds (iframes) URL is displayed as text/link — iframe content is not rendered

Format-specific notes

HTML (light/dark)

  • Fully self-contained single-file output — no external dependencies
  • Markdown links become clickable <a> tags with target="_blank"
  • Bare URLs are auto-linked
  • Canvas dimensions are preserved exactly (absolute positioning)
  • Both themes use the same layout; only colors differ

Excalidraw

  • Outputs raw .excalidraw JSON (opens in Obsidian's Excalidraw plugin in compatibility mode, or in excalidraw.com)
  • Single-link text nodes: the link URL is attached to the rectangle element (clickable in Excalidraw)
  • Multi-link text nodes: URLs are shown inline in the text (e.g. label (https://...)) since Excalidraw only supports one link per element
  • Markdown formatting is stripped to plain text
  • Groups rendered as dashed rectangles with labels

Mermaid

  • Outputs a flowchart TD diagram
  • Groups become subgraph blocks
  • All text is stripped to plain text with URLs shown inline
  • Node colors applied via style directives
  • Edge labels preserved

D2

  • Outputs a direction: down diagram
  • Groups become nested containers with optional styling
  • Nodes inside groups use qualified IDs (e.g. group.node)
  • Link nodes get a .link property
  • Colors applied via style blocks

PDF

  • Renders the light HTML theme to PDF via Electron's printToPDF
  • Page size matches the canvas dimensions
  • Requires desktop Obsidian (Electron)
  • If PDF generation fails (e.g. Electron API unavailable), a warning is shown but other formats still export

Settings

  • Group title size (%) — font size of group labels relative to body text (default: 150%)
  • Output subfolder — leave empty to export alongside the canvas, or specify a subfolder name

Installation

From Obsidian Community Plugins

  1. Open Settings -> Community plugins -> Browse
  2. Search for "Canvas Export"
  3. Click Install, then Enable

Manual

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Create .obsidian/plugins/canvas-export/ in your vault
  3. Copy the three files into that folder
  4. Enable the plugin in Settings -> Community plugins

Desktop only

This plugin uses Electron APIs for PDF export and is desktop-only.

Author

Robin Moffatt (@rmoff)

License

Apache License 2.0