项目作者: corpix

项目描述 :
Org-babel support for blockdiag
高级语言: Emacs Lisp
项目地址: git://github.com/corpix/ob-blockdiag.el.git
创建时间: 2017-05-08T20:39:30Z
项目社区:https://github.com/corpix/ob-blockdiag.el

开源协议:GNU General Public License v3.0

下载


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:

  1. M-x
  2. package-install
  3. ob-blockdiag

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

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

Example

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

  1. #+BEGIN_SRC blockdiag :tool blockdiag-3.5 :file ololo.png
  2. blockdiag {
  3. A [label = "foo"];
  4. B [label = "bar"];
  5. C [label = "baz"];
  6. A -> B [label = "click bar", textcolor="red"];
  7. B -> C [label = "click baz"];
  8. C -> A;
  9. }
  10. #+END_SRC

Arguments

There are some things you could customize:

  1. - `:tool` if you have blockdiag in unusual location or want to use seqdiag or [others](http://blockdiag.com/en/#table-of-contents)
  2. - `:transparency t` to make transparent background of diagram (PNG only)
  3. - `:antialias t` pass diagram image to anti-alias filter
  4. - `:font` if you want the `:tool` to use provided font
  5. - `:size` if you want the `:tool` to use custom size
  6. - `: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.