Skip to content

corpix/ob-blockdiag.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

ob-blockdiag.el

An extension for org-babel to support blockdiag.

Installation

This package is availaple in MELPA.

How to enable MELPA.

With "MELPA enabled emacs" you could install this package by typing this sequence:

M-x
package-install
ob-blockdiag
⏎

Now you could enable this package in your Emacs config with:

(org-babel-do-load-languages 'org-babel-load-languages
 '((blockdiag . t))
)

Example

Blockdiag in Fedora installed from python3-blockdiag package which has unusual executable name. Output file name is ololo.png

#+BEGIN_SRC blockdiag :tool blockdiag-3.5 :file ololo.png
blockdiag {
   A [label = "foo"];
   B [label = "bar"];
   C [label = "baz"];
   A -> B [label = "click bar", textcolor="red"];
   B -> C [label = "click baz"];
   C -> A;
}
#+END_SRC

Arguments

There are some things you could customize:

- `:tool` if you have blockdiag in unusual location or want to use seqdiag or [others](http://blockdiag.com/en/#table-of-contents)
- `:transparency t` to make transparent background of diagram (PNG only)
- `:antialias t` pass diagram image to anti-alias filter
- `:font` if you want the `:tool` to use provided font
- `:size` if you want the `:tool` to use custom size
- `:type` if you want the `:tool` to use different file format type, e.g. pdf, svg

Errors and output

It recreates a buffer with name *ob-blockdiag* every time you evaluating something.

There will be errors and output.