lang/markdown: auto-resolve build & open programs
Markdown-mode will now auto-detect a markdown compiler when you use markdown-preview (SPC m b). It will try marked, pandoc and markdown, in that order. As for markdown-open, it will now use "open" on MacOS and "xdg-open" on Linux, by default.
This commit is contained in:
parent
2e6d8be6fc
commit
30319d1c3e
2 changed files with 62 additions and 1 deletions
|
@ -1,5 +1,19 @@
|
|||
;;; lang/markdown/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +markdown-compile-functions
|
||||
'(+markdown-compile-marked
|
||||
+markdown-compile-pandoc
|
||||
+markdown-compile-markdown)
|
||||
"A list of commands to try when attempting to build a markdown file with
|
||||
`markdown-open' or `markdown-preview', stopping at the first one to return non-nil.
|
||||
|
||||
Each function takes three argument. The beginning position of the region to
|
||||
capture, the end position, and the output buffer.")
|
||||
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
|
||||
(def-package! markdown-mode
|
||||
:mode ("/README\\(?:\\.\\(?:markdown\\|md\\)\\)?\\'" . gfm-mode)
|
||||
:init
|
||||
|
@ -11,7 +25,11 @@
|
|||
markdown-fontify-code-blocks-natively t
|
||||
markdown-hide-urls nil ; trigger with `markdown-toggle-url-hiding'
|
||||
markdown-enable-math t ; syntax highlighting for latex fragments
|
||||
markdown-gfm-uppercase-checkbox t) ; for compat with org-mode
|
||||
markdown-gfm-uppercase-checkbox t ; for compat with org-mode
|
||||
markdown-command #'+markdown-compile
|
||||
markdown-open-command
|
||||
(cond (IS-MAC "open")
|
||||
(IS-LINUX "xdg-open")))
|
||||
|
||||
:config
|
||||
(set-flyspell-predicate! '(markdown-mode gfm-mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue