From d066b6c848a48cb3cd6ac1562eb840c4a10101e0 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 19 Apr 2022 11:17:47 +0100 Subject: Add alectryon config --- doom/config.org | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doom/config.org b/doom/config.org index b99b2b2..2f18499 100644 --- a/doom/config.org +++ b/doom/config.org @@ -1005,7 +1005,19 @@ https://yannherklotz.com") :hook (coq-mode . alectryon-mode) :config (map! :map alectryon-mode-map - "C-c u t" #'alectryon-toggle)) + "C-c u t" #'alectryon-toggle + "C-c u p" #'ymhg/alectryon-preview) + (defun ymhg/alectryon-preview () + "Display an HTML preview of the current buffer." + (interactive) + (let* ((html-fname (make-temp-file "alectryon" nil ".html")) + (args `("-r" "5" "-" ,html-fname))) + (apply #'call-process-region nil nil "rst2html5" nil nil nil args) + (message "Compilation complete") + (browse-url html-fname)))) + +(use-package! ox-context + :after org) (use-package! ox-tufte :after org -- cgit