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)))
|
(t (copy-file link new-path)))
|
||||||
(insert (format "[[./%s]]" (abbreviate-file-name 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
|
;;;###autoload
|
||||||
(defun narf/org-remove-link ()
|
(defun narf/org-remove-link ()
|
||||||
"Replace an org link by its description or if empty its address"
|
"Replace an org link by its description or if empty its address"
|
||||||
|
|
|
@ -11,27 +11,32 @@
|
||||||
:init
|
:init
|
||||||
(add-hook! markdown-mode 'narf|enable-hard-wrap)
|
(add-hook! markdown-mode 'narf|enable-hard-wrap)
|
||||||
:config
|
:config
|
||||||
(bind! :map markdown-mode-map
|
(add-hook! markdown-mode
|
||||||
"<backspace>" nil
|
(exmap! "preview" 'narf/markdown-preview)
|
||||||
"<M-left>" nil
|
(exmap! "export" 'narf:org-export))
|
||||||
"<M-right>" nil
|
(bind! (:map markdown-mode-map
|
||||||
|
"<backspace>" nil
|
||||||
|
"<M-left>" nil
|
||||||
|
"<M-right>" nil
|
||||||
|
|
||||||
"M-*" 'markdown-insert-list-item
|
;; Assumes you have a markdown renderer plugin in chrome
|
||||||
"M-b" 'markdown-insert-bold
|
:nv "M-r" (λ (narf-open-with "Google Chrome"))
|
||||||
"M-i" 'markdown-insert-italic
|
|
||||||
"M-`" 'narf/markdown-insert-del
|
|
||||||
|
|
||||||
(:prefix "," ; <leader>
|
"M-*" 'markdown-insert-list-item
|
||||||
:nv "i" 'markdown-insert-image
|
"M-b" 'markdown-insert-bold
|
||||||
:nv "l" 'markdown-insert-link
|
"M-i" 'markdown-insert-italic
|
||||||
:nv "L" 'markdown-insert-reference-link-dwim
|
"M-`" 'narf/markdown-insert-del
|
||||||
:nv "b" 'markdown-preview)
|
|
||||||
|
|
||||||
;; TODO: Make context sensitive
|
:nv ",i" 'markdown-insert-image
|
||||||
:n "[p" 'markdown-promote
|
:nv ",l" 'markdown-insert-link
|
||||||
:n "]p" 'markdown-demote
|
: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
|
;; TODO: Test previewing capability
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue