Add narf:org-export (and for markdown-mode too)
This commit is contained in:
parent
c1147e912b
commit
2a1809cf63
2 changed files with 33 additions and 17 deletions
|
@ -226,6 +226,17 @@ COUNT-FOOTNOTES? is non-nil."
|
|||
(t (copy-file link new-path)))
|
||||
(insert (format "[[./%s]]" (abbreviate-file-name new-path))))))
|
||||
|
||||
;;;###autoload (autoload 'narf:org-export "defuns-org" nil t)
|
||||
(evil-define-command narf:org-export (dest)
|
||||
(interactive "<a>")
|
||||
(let ((path (if (string-match-p "^[/~]" dest)
|
||||
dest
|
||||
(expand-file-name dest default-directory))))
|
||||
(shell-command
|
||||
(format "/usr/local/bin/pandoc '%s' -o '%s'"
|
||||
(buffer-file-name) path))
|
||||
(message "Done! Exported to: %s" path)))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/org-remove-link ()
|
||||
"Replace an org link by its description or if empty its address"
|
||||
|
|
|
@ -11,27 +11,32 @@
|
|||
:init
|
||||
(add-hook! markdown-mode 'narf|enable-hard-wrap)
|
||||
:config
|
||||
(bind! :map markdown-mode-map
|
||||
"<backspace>" nil
|
||||
"<M-left>" nil
|
||||
"<M-right>" nil
|
||||
(add-hook! markdown-mode
|
||||
(exmap! "preview" 'narf/markdown-preview)
|
||||
(exmap! "export" 'narf:org-export))
|
||||
(bind! (:map markdown-mode-map
|
||||
"<backspace>" nil
|
||||
"<M-left>" nil
|
||||
"<M-right>" nil
|
||||
|
||||
"M-*" 'markdown-insert-list-item
|
||||
"M-b" 'markdown-insert-bold
|
||||
"M-i" 'markdown-insert-italic
|
||||
"M-`" 'narf/markdown-insert-del
|
||||
;; Assumes you have a markdown renderer plugin in chrome
|
||||
:nv "M-r" (λ (narf-open-with "Google Chrome"))
|
||||
|
||||
(:prefix "," ; <leader>
|
||||
:nv "i" 'markdown-insert-image
|
||||
:nv "l" 'markdown-insert-link
|
||||
:nv "L" 'markdown-insert-reference-link-dwim
|
||||
:nv "b" 'markdown-preview)
|
||||
"M-*" 'markdown-insert-list-item
|
||||
"M-b" 'markdown-insert-bold
|
||||
"M-i" 'markdown-insert-italic
|
||||
"M-`" 'narf/markdown-insert-del
|
||||
|
||||
;; TODO: Make context sensitive
|
||||
:n "[p" 'markdown-promote
|
||||
:n "]p" 'markdown-demote
|
||||
:nv ",i" 'markdown-insert-image
|
||||
:nv ",l" 'markdown-insert-link
|
||||
:nv ",L" 'markdown-insert-reference-link-dwim
|
||||
:nv ",b" 'markdown-preview
|
||||
|
||||
:i "M--" 'markdown-insert-hr))
|
||||
;; TODO: Make context sensitive
|
||||
:n "[p" 'markdown-promote
|
||||
:n "]p" 'markdown-demote
|
||||
|
||||
:i "M--" 'markdown-insert-hr)))
|
||||
|
||||
;; TODO: Test previewing capability
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue