On 2013-06-26 11:23, Karl Voit wrote:
Hi!
I would like to define my diagram with the following two tables: one
for the node definitions and one for the interconnections between
notes. The syntax should be pretty self-explanatory (or at least I
hope so):
I (not an ELISP hacker) would have to use Python and write a table
parsing class which will get too complicated for my taste :-(
However, my guess is that this could be implemented in ELISP with
much less effort.
Two things:
1. You don't need to write table parsing code, as passing in a
table as an argument to a code block will convert it to an
array. For example:
#+name: ptable
| head1 | head2 |
|-------+-------|
| a | 1 |
| b | 2 |
#+BEGIN_SRC python :var t=ptable :results value
return t
#+END_SRC
#+RESULTS:
| a | 1 |
| b | 2 |
and the python code generated (view w/
`org-babel-expand-src-block'):
t=[["a", 1], ["b", 2]]
return t
2. You can also use the pydot or pygraphviz libraries for
generating the graph directly from python instead of generating
dot code.
rick