Add function for inlining an edraw file

This commit is contained in:
MitchMarq42 2023-03-08 08:58:30 -09:00
parent 115b665ffd
commit 1e4710537e

View File

@ -59,8 +59,21 @@
:after org :after org
:config :config
(require 'edraw-org) (require 'edraw-org)
(edraw-org-setup-default)) (edraw-org-setup-default)
;; following function taken from https://github.com/wn/doom.d/blob/46ca46f2ef21e933fb76b1568be1a62b262ed288/config.el#L47
(defun org-mode-open-edraw (&optional filename)
(interactive)
(let ((filename (or filename
(concat "./"
(file-relative-name
(read-file-name (edraw-msg "Write svg file: ")
default-directory)
default-directory)))))
(insert (format "[[edraw:file=%s]]" filename))
(backward-char)
(org-return))))
;; diminish ;; diminish
(use-package diminish) (use-package diminish)