]> git.donarmstrong.com Git - lib.git/commitdiff
Merge branch 'master' of git+ssh://git.donarmstrong.com/srv/git/lib
authorDon Armstrong <don@donarmstrong.com>
Wed, 30 Nov 2016 16:44:18 +0000 (10:44 -0600)
committerDon Armstrong <don@donarmstrong.com>
Wed, 30 Nov 2016 16:44:18 +0000 (10:44 -0600)
templates/makefiles/org_to_doc.mk [new file with mode: 0644]

diff --git a/templates/makefiles/org_to_doc.mk b/templates/makefiles/org_to_doc.mk
new file mode 100644 (file)
index 0000000..8d65796
--- /dev/null
@@ -0,0 +1,10 @@
+EMACSARGS?=--batch  -l ~/.emacs 
+EMACS?=emacs
+
+# The tempdir here is because libreoffice doesn't properly handle two
+# instances using the same home directory, and will fail if you're
+# exporting with another libreoffice instance open.
+$(DOC_TARGETS): %.doc: %.org
+       TEMPDIR="$$(mktemp -d)"; \
+       SYSUSERCONFIG="file://$$TEMPDIR" $(EMACS) $(EMACSARGS) --visit $^ --eval '(setq org-odt-preferred-output-format "doc")' --funcall org-odt-export-to-odt; \
+       rm -rf "$$TEMPDIR";