ob-doc-ditaa.org 3.7 KB

Org Mode support for ditaa

Template Checklist [12/12] noexport

Introduction

Requirements and Setup

  • [X] Revise #+TITLE:
  • [X] Indicate #+AUTHOR:
  • [X] Add #+EMAIL:
  • [X] Revise banner source block [3/3]
  • [X] Add link to a useful language web site
  • [X] Replace "Language" with language name
  • [X] Find a suitable graphic and use it to link to the language
  • web site
  • [X] Write an Introduction
  • [X] Describe Requirements and Setup
  • [X] Replace "Language" with language name in Org Mode Features for Language Source Code Blocks
  • [X] Describe Header Arguments
  • [X] Describe support for Sessions
  • [X] Describe Result Types
  • [X] Describe Other differences from supported languages
  • [X] Provide brief Examples of Use
  • =Ditaa= is a command-line utility that converts diagrams drawn using ASCII art into bitmap graphics. =Ditaa= is distributed with =Org mode=. The file =ditaa.jar= can be found in =contrib/scripts=.

Activate evaluation of ditaa source code blocks by adding ditaa to =org-babel-load-languages=.


    (org-babel-do-load-languages
     'org-babel-load-languages
     '((ditaa . t))) ; this line activates ditaa

Org Mode Features for ditaa Source Code Blocks

Header Arguments

Sessions

Result Types

Examples of Use

file
ditaa source code blocks require that an output file
be specified.
cmdline
specify command line arguments for ditaa
java
arguments for the java runtimes (JRE)
=ditaa= does not support sessions. =Ditaa= source code blocks return a link to a [[http://www.libpng.org/pub/png/][png]] bitmap file. The obligatory Hello World! example in =ditaa=:

#+BEGIN_SRC ditaa :file images/hello-world.png
+--------------+
|              |
| Hello World! |
|              |
+--------------+


+--------------+
|              |
| Hello World! |
|              |
+--------------+

images/hello-world.png

Now, round all corners by passing ditaa the =-r,--round-corners= command line switch.


#+BEGIN_SRC ditaa :file images/hello-world-round.png :cmdline -r
+--------------+
|              |
| Hello World! |
|              |
+--------------+


+--------------+
|              |
| Hello World! |
|              |
+--------------+

images/hello-world-round.png