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.
45 lines
1.8 KiB
EmacsLisp
45 lines
1.8 KiB
EmacsLisp
((nil . ((whitespace-action auto-cleanup)
|
|
(whitespace-style face empty trailing lines-tail)
|
|
(require-final-newline . t)
|
|
(mode . whitespace)))
|
|
(org-mode . ((whitespace-style face empty trailing)
|
|
(eval .
|
|
(progn
|
|
(setq org-babel-sh-command (concat "PATH=../../src/bin"
|
|
path-separator
|
|
"$PATH sh"))
|
|
(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]")
|
|
(org-babel-do-load-languages 'org-babel-load-languages
|
|
'((sh . t)
|
|
(python . t)
|
|
(dot . t)
|
|
(C . t)))))
|
|
(org-confirm-babel-evaluate . nil)
|
|
(org-babel-python-command . "/usr/bin/python3")
|
|
(org-babel-C++-compiler . "./g++wrap")
|
|
(org-publish-project-alist
|
|
. (("spot-html"
|
|
:base-directory "."
|
|
:base-extension "org"
|
|
:publishing-directory "../userdoc/"
|
|
:recursive t
|
|
:publishing-function org-publish-org-to-html
|
|
; Org 8
|
|
:html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"spot.css\" />"
|
|
; Org 7
|
|
:style "<link rel=\"stylesheet\" type=\"text/css\" href=\"spot.css\" />"
|
|
:auto-preamble t)
|
|
("spot-static"
|
|
:base-directory "."
|
|
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf"
|
|
:publishing-directory "../userdoc/"
|
|
:recursive t
|
|
:publishing-function org-publish-attachment)
|
|
("spot-all" :components ("spot-html" "spot-static")))))))
|