diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index 74c8b5601..53b226708 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -3,6 +3,9 @@ (def-package! markdown-mode :mode ("/README\\(?:\\.\\(?:markdown\\|md\\)\\)?\\'" . gfm-mode) :init + (when (featurep! +pandoc) + (setq markdown-command "pandoc --from=markdown --to=html --standalone --mathjax --highlight-style=pygments")) + (setq markdown-enable-wiki-links t markdown-italic-underscore t markdown-asymmetric-header t @@ -47,3 +50,10 @@ :nv "t" #'markdown-toc-generate-toc :nv "i" #'markdown-insert-image :nv "l" #'markdown-insert-link))) + +(def-package! pandoc-mode + :when (featurep! +pandoc) + :commands + pandoc-mode + :hook + (markdown-mode . conditionally-turn-on-pandoc)) diff --git a/modules/lang/markdown/doctor.el b/modules/lang/markdown/doctor.el new file mode 100644 index 000000000..8224429f9 --- /dev/null +++ b/modules/lang/markdown/doctor.el @@ -0,0 +1,6 @@ +;; -*- lexical-binding: t; no-byte-compile: t; -*- +;;; lang/markdown/doctor.el + +(when (featurep! +pandoc) + (unless (executable-find "pandoc") + (warn! "Couldn't find pandoc, markdown-mode may have issues")) diff --git a/modules/lang/markdown/packages.el b/modules/lang/markdown/packages.el index 72eee45f7..bccae4844 100644 --- a/modules/lang/markdown/packages.el +++ b/modules/lang/markdown/packages.el @@ -4,3 +4,7 @@ (package! markdown-mode) (package! markdown-toc) +(when (featurep! +pandoc) + (package! pandoc-mode)) + +