فهرست منبع

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
Nick Daly 4 سال پیش
والد
کامیت
7da20ff219
1فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 10 0
      lisp/ob-plantuml.el

+ 10 - 0
lisp/ob-plantuml.el

@@ -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)