descriptions and keybindings as per ox-hugo docs

Mimicks the ox menu `C-c C-e H #`
This commit is contained in:
Lorenzo Giuliani 2019-08-30 17:23:47 +02:00
parent 8fd3bd80da
commit 8457d2f825
2 changed files with 25 additions and 6 deletions

View file

@ -868,6 +868,7 @@ compelling reason, so..."
;;; Custom org modules
(if (featurep! +dragndrop) (load! "contrib/dragndrop"))
(if (featurep! +hugo) (load! "contrib/+hugo"))
(if (featurep! +ipython) (load! "contrib/ipython"))
(if (featurep! +present) (load! "contrib/present"))

View file

@ -1,12 +1,30 @@
;;; +hugo.el --- ox-hugo support -*- lexical-binding: t; -*-
;;;###if (featurep! +hugo)
(defun org-hugo-doom-subtree-to-file-and-open ()
(interactive)
(org-open-file (org-hugo-export-wim-to-md)))
(defun org-hugo-doom-to-file-and-open ()
(interactive)
(org-open-file (org-hugo-export-to-md)))
(defun org-hugo-doom-all-subtrees-to-files ()
(interactive)
(org-hugo-export-wim-to-md :all-subtrees))
(use-package! ox-hugo
:after ox
:after ox)
(map! :map org-mode-map
:localleader
(:prefix ("e" . "export")
:desc "to hugo" "h" #'org-hugo-export-to-md
:desc "to hugo & open" "H" #'org-hugo-export-as-md)))
(:prefix "e"
(:prefix ("H" . "hugo")
:desc "Subtree to file" "H" #'org-hugo-export-wim-to-md
:desc "To file" "h" #'org-hugo-export-wim-to-md
:desc "Subtree to file & open" "O" #'org-hugo-doom-subtree-to-file-and-open
:desc "To file & open" "o" #'org-hugo-doom-to-file-and-open
:desc "All subtrees to files" "a" #'org-hugo-doom-all-subtrees-to-files
:desc "To temporary buffer" "t" #'org-hugo-export-as-md)))
;;; +hugo.el ends here