Node module for exporting Diagrams.net (Draw.io) diagrams embedded in a published Dendron site to SVG.
Embed your diagrams in your notes as if they were images:
![My awesome diagram](assets/diagrams/my.awesome.diagram.drawio)
If your diagram has multiple pages, specify the page number (zero-indexed; defaults to 0) in the URL:
![My awesome diagram](assets/diagrams/my.awesome.diagram.drawio#3)
From the root of your Dendron workspace (where the dendron.code-workspace
and dendron.yml
files are), install the plugin:
npm install --save-dev dendron-publish-drawio
Publishing a Dendron site involves running the following commands:
npx dendron publish init
npx dendron publish build --wsRoot . --vault public --sitemap
cd .next/
npm run export
We need to add a step, between dendron publish build
and npm run export
:
npx dendron publish init
npx dendron publish build --wsRoot . --vault public --sitemap
npx dendron-publish-drawio
cd .next/
npm run export
Note that if you customise Dendron's site:assetsPrefix
option (or set it via --overrides=assetsPrefix=...
) you'll need to set the DENDRON_ASSETS_PREFIX
environment variable to the same value when running dendron-publish-drawio
:
export DENDRON_ASSETS_PREFIX=/etc npx dendron-publish-drawio