From 308d06cd40913416fab1fa77db7ddbc6ec5a2878 Mon Sep 17 00:00:00 2001 From: Tim Harper Date: Sun, 5 Mar 2023 20:55:36 -0700 Subject: [PATCH] add server-pico as option for exec-mode server-pico is a minimal plantuml web server that does not support the /language endpoint To cope with this, we grab language settings from the jar itself, but then use server-pico for rendering --- plantuml-mode.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plantuml-mode.el b/plantuml-mode.el index e40ba0d..8902858 100644 --- a/plantuml-mode.el +++ b/plantuml-mode.el @@ -133,7 +133,10 @@ (defcustom plantuml-default-exec-mode 'server "Default execution mode for PlantUML. Valid values are: -- `jar': run PlantUML as a JAR file (requires a local install of the PlantUML JAR file, see `plantuml-jar-path'" +- `jar': run PlantUML as a JAR file (requires a local install of the PlantUML JAR file, see `plantuml-jar-path' +- `server': run PlantUML against a tomcat/jetty hosted servlet. Requires specification of `plantuml-server-url' +- `server-pico': run PlantUML against a pico server. Requires both specification of `plantuml-jar-path', and the `plantuml-server-url' +- `executable': run PlantUML as a bin executable. Requires `plantuml-executable-path'." :type 'symbol :group 'plantuml :options '(jar server executable)) @@ -281,6 +284,7 @@ (let ((get-fn (pcase mode ('jar #'plantuml-jar-get-language) ('server #'plantuml-server-get-language) + ('server-pico #'plantuml-jar-get-language) ;; pico server does not support the endpoint, so get the details from the jar instead ('executable #'plantuml-executable-get-language)))) (if get-fn (funcall get-fn buf) @@ -474,6 +478,7 @@ Put the result into buffer BUF, selecting the window according to PREFIX: (let ((preview-fn (pcase mode ('jar #'plantuml-jar-preview-string) ('server #'plantuml-server-preview-string) + ('server-pico #'plantuml-server-preview-string) ('executable #'plantuml-executable-preview-string)))) (if preview-fn (funcall preview-fn prefix string buf)