Code Monkey home page Code Monkey logo

dendron-publish-drawio's Introduction

Export Diagrams.net diagrams during Dendron site publishing

Node module for exporting Diagrams.net (Draw.io) diagrams embedded in a published Dendron site to SVG.


Usage

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)

Installation

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

dendron-publish-drawio's People

Contributors

dependabot[bot] avatar lukecarrier avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dendron-publish-drawio's Issues

Correctly rewrite image sources in embedded markdown

Right now we seek out img[src] attributes in our regexp, which will work for HTML exported notes. It doesn't look like we correctly write out ![alt text](src) references in Markdown files, which might be a problem if Dendron does more client-side rendering in the future.

We should use a different regexp for each file extension.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.