org: add a first code example

The difficulty is not the example, but setting up org-mode to allow
Python and C++ example that use the local libraries, not those
installed system-wide.

* doc/org/.dir-locals.el: Rename as...
* doc/org/.dir-locals.el.in: ... this, so we can easily define
PYTHONPATH and other environment variables.
* doc/org/init.el.in: Enable C++, and make sure but Python
and C++ use the local libraries.
* doc/org/g++wrap.in, doc/org/tut01.org: New files.
* doc/Makefile.am, configure.ac: Adjust.
* wrap/python/spot.py (to_str): Take a parenth argument.
This commit is contained in:
Alexandre Duret-Lutz 2015-06-02 23:53:04 +02:00
parent 16336be3cc
commit 8de524adb0
7 changed files with 255 additions and 10 deletions

View file

@ -13,17 +13,26 @@
;; conditions when doing concurrent builds.
(setq org-publish-timestamp-directory "@abs_top_builddir@/.org-timestamps/")
(setq org-babel-python-command "/usr/bin/python3")
(org-babel-do-load-languages
'org-babel-load-languages
'((sh . t)
(dot . t)
(python . t)))
(python . t)
(C . t)))
(setq org-confirm-babel-evaluate nil)
(setq org-babel-sh-command
(concat "PATH=@abs_top_builddir@/src/bin" path-separator "$PATH sh"))
(setq org-babel-python-command "/usr/bin/python3")
(setq org-babel-C++-compiler "./g++wrap")
(setenv "PYTHONPATH"
(concat "@abs_top_builddir@/wrap/python/.libs:@abs_top_builddir@/wrap/python:@abs_top_srcdir@/wrap/python:"
(getenv "PYTHONPATH")))
(setenv "DYLD_LIBRARY_PATH"
(concat "@abs_top_builddir@/wrap/python/.libs:@abs_top_builddir@/src/.libs:@abs_top_builddir@/buddy/src/.libs:"
(getenv "DYLD_LIBRARY_PATH")))
(setenv "SPOT_DOTDEFAULT" "Brf(Lato)")
(setenv "SPOT_DOTEXTRA"
"node[style=filled, fillcolor=\"#ffffa0\"] edge[arrowhead=vee, arrowsize=.7]")