0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-27 11:30:57 +00:00

lisp/ob-plantuml.el: New option `org-babel-plantuml-svg-text-to-path'

* lisp/ob-plantuml.el (org-babel-plantuml-svg-text-to-path): New option.
(org-babel-execute:plantuml): Use the new option to add a SVG-specific
post-export step that runs inkscape text-to-path replacement over
the output file.

TINYCHANGE
This commit is contained in:
Nick Daly 2021-05-01 10:58:25 +02:00 committed by Bastien Guerry
parent 7c99d15557
commit 7da20ff219

View file

@ -71,6 +71,12 @@ You can also configure extra arguments via `org-plantuml-executable-args'."
:package-version '(Org . "9.4")
:type '(repeat string))
(defcustom org-babel-plantuml-svg-text-to-path nil
"When non-nil, export text in SVG images to paths using Inkscape."
:group 'org-babel
:package-version '(Org . "9.5")
:type 'boolean)
(defun org-babel-variable-assignments:plantuml (params)
"Return a list of PlantUML statements assigning the block's variables.
PARAMS is a property list of source block parameters, which may
@ -145,6 +151,10 @@ This function is called by `org-babel-execute-src-block'."
" ")))
(with-temp-file in-file (insert full-body))
(message "%s" cmd) (org-babel-eval cmd "")
(org-babel-plantuml-post-process out-file)
(if (and (string= (file-name-extension out-file) "svg")
org-babel-plantuml-svg-text-to-path)
(org-babel-eval (format "inkscape %s -T -l %s" out-file out-file) ""))
nil)) ;; signal that output has already been written to file
(defun org-babel-prep-session:plantuml (_session _params)