emacs: Add plantuml wrapper so org-mode can work with plantuml-server
This commit is contained in:
parent
59cee7f975
commit
1524994bab
2 changed files with 54 additions and 20 deletions
|
@ -1798,6 +1798,8 @@ Configuration
|
||||||
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
|
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
|
||||||
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
|
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
|
||||||
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
|
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
|
||||||
|
(setq org-plantuml-exec-mode 'plantuml
|
||||||
|
org-plantuml-executable-path "plantuml-client")
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
=org-capture= allows creating and saving quick notes, links and TODOs
|
=org-capture= allows creating and saving quick notes, links and TODOs
|
||||||
|
|
|
@ -8,6 +8,37 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.eboskma.programs.emacs;
|
cfg = config.eboskma.programs.emacs;
|
||||||
|
|
||||||
|
plantuml-client = pkgs.writeShellApplication {
|
||||||
|
name = "plantuml-client";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
coreutils
|
||||||
|
xh
|
||||||
|
];
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
type=
|
||||||
|
while getopts ":t:" option; do
|
||||||
|
case "''${option}" in
|
||||||
|
t)
|
||||||
|
type="''${OPTARG}";;
|
||||||
|
\?)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
tempfile=$(mktemp --suffix plantuml)
|
||||||
|
|
||||||
|
while IFS= read -r line; do
|
||||||
|
echo "''${line}" >> "''${tempfile}"
|
||||||
|
done
|
||||||
|
|
||||||
|
encoded=$(xh --print=b post http://localhost:5080/plantuml/coder Content-Type:text/plain < "''${tempfile}")
|
||||||
|
rm "''${tempfile}"
|
||||||
|
|
||||||
|
xh get "http://localhost:5080/plantuml/''${type}/''${encoded}"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
tangleEmacsConfig =
|
tangleEmacsConfig =
|
||||||
initFile:
|
initFile:
|
||||||
pkgs.runCommand "tangled-emacs-${initFile}" { } ''
|
pkgs.runCommand "tangled-emacs-${initFile}" { } ''
|
||||||
|
@ -173,6 +204,7 @@ in
|
||||||
}))
|
}))
|
||||||
nixfmt-rfc-style
|
nixfmt-rfc-style
|
||||||
python3
|
python3
|
||||||
|
plantuml-client
|
||||||
]
|
]
|
||||||
++ (with aspellDicts; [
|
++ (with aspellDicts; [
|
||||||
en
|
en
|
||||||
|
|
Loading…
Reference in a new issue