2017-07-08 23:05:23 +02:00
|
|
|
;;; lang/plantuml/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! plantuml-mode
|
2018-05-25 00:46:11 +02:00
|
|
|
:defer t
|
2018-02-14 07:40:05 -05:00
|
|
|
:init
|
2018-03-01 11:16:00 +08:00
|
|
|
(setq plantuml-jar-path (concat doom-etc-dir "plantuml.jar")
|
|
|
|
org-plantuml-jar-path plantuml-jar-path)
|
2018-02-14 07:40:05 -05:00
|
|
|
:config
|
2018-06-18 02:26:05 +02:00
|
|
|
(set-popup-rule! "^\\*PLANTUML" :size 0.4 :select nil :ttl 0))
|
2017-07-08 23:05:23 +02:00
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! flycheck-plantuml
|
2019-02-22 00:20:29 -05:00
|
|
|
:when (featurep! :tools flycheck)
|
2017-07-08 23:05:23 +02:00
|
|
|
:after plantuml-mode
|
|
|
|
:config (flycheck-plantuml-setup))
|
2019-09-07 12:27:23 +08:00
|
|
|
|
2019-09-13 21:59:03 -04:00
|
|
|
|
2019-09-07 12:27:23 +08:00
|
|
|
(after! ob-plantuml
|
|
|
|
(defadvice! +plantuml--fix-atstart-in-org-src-blocks-a (args)
|
2019-09-13 21:59:03 -04:00
|
|
|
"Fix error when executing plantuml src blocks in org-mode for code that
|
|
|
|
begins with '@'. This character needs to be escaped with a backslash or comma
|
|
|
|
for the block to execute correctly, so we do it automatically."
|
2019-09-07 12:27:23 +08:00
|
|
|
:filter-args #'org-babel-execute:plantuml
|
|
|
|
(cl-destructuring-bind (body params) args
|
|
|
|
(let* ((origin-body body)
|
|
|
|
(fix-body
|
|
|
|
(replace-regexp-in-string
|
2019-09-08 00:16:08 +08:00
|
|
|
"^[[:blank:]\n]*\\(@start\\)"
|
2019-09-07 12:27:23 +08:00
|
|
|
"\\\\\\1"
|
|
|
|
origin-body)))
|
|
|
|
(list fix-body params))))
|
2019-09-13 21:59:03 -04:00
|
|
|
|
2019-09-07 12:27:23 +08:00
|
|
|
(add-to-list 'org-babel-default-header-args:plantuml
|
|
|
|
'(:cmdline . "-charset utf-8")))
|