Skip to content

kimim/org-drawio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

A small tool to convert .drawio file to .svg file and insert it to orgmode on-the-fly.

You may want to try a more general solution (https://github.com/kimim/chatu) which supports both orgmode and markdown, and drawio, plantuml, clojure, R …

Install

Before using org-drawio, you may need to install drawio and pdf2svg in your PATH.

From melpa with use-package:

(use-package org-drawio
  :commands (org-drawio-add
             org-drawio-open)
  :custom ((org-drawio-input-dir "./draws")
           (org-drawio-output-dir "./images")
           (org-drawio-output-page "0")
           ;; set to t, if you want to crop the image.
           (org-drawio-crop nil)))

Or git submodule and use-package

(use-package org-drawio
  :load-path "~/.emacs.d/site-lisp/org-drawio"
  :commands (org-drawio-add
             org-drawio-open)
  :custom ((org-drawio-input-dir "./draws")
           (org-drawio-output-dir "./images")
           (org-drawio-output-page "0")
           ;; set to t, if you want to crop the image.
           (org-drawio-crop nil)))

Usage

Move cursor to #+drawio line, and invoke org-drawio-add to add image, org-drawio-open to open original .drawio file.

Remind!

  • the .drawio file should be the first parameter.
  • in order to support whitespace in file and dir name, please “quote all of them”.
#+drawio: "diagram.drawio"

or omit the extension .drawio

#+drawio: "diagram"

./images/diagram-0.svg

It is also possible to extract specific page.

#+drawio: "diagram.drawio" :page 1

./images/diagram-1.svg

Even more specific about input-dir, output-dir and output file name:

#+drawio: "diagram.drawio" :page 0 :input-dir "./draws" :output-dir "./images" :output "diagram.svg"

./images/diagram.svg

About

Handle drawio in orgmode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published