Skip to content

Commit

Permalink
Merge pull request #3 from zonuexe/fix/copyit-pandoc-command
Browse files Browse the repository at this point in the history
Fix copyit-pandoc commands and documented it
  • Loading branch information
zonuexe authored Sep 19, 2019
2 parents 309294c + fe8d434 commit d184e88
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
| =M-x copyit-pandoc-export-to-html= | Convert and Copy file as HTML |
| =M-x copyit-pandoc-export-to-markdown= | Convert and Copy file as Markdown |

=C-u M-x copyit-pandoc-export-to-html= and =C-u M-x copyit-pandoc-export-to-markdown= convert current buffer file.
=C-u M-x copyit-pandoc-export-to-html= and =C-u M-x copyit-pandoc-export-to-markdown= convert a file. When =C-u= is prepended, the content of the current buffer is converted.

** Customize
*** =copyit-binary-file-copy-method= (default: =data-uri=)
Expand Down
24 changes: 12 additions & 12 deletions copyit-pandoc.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@
(defun copyit-pandoc-export-to-html (file-path)
"Convert and Copy `FILE-PATH' file as HTML."
(interactive "p")
(cond
((null file-path)
(setq file-path (read-file-name "")))
((and (equal 4 file-path) buffer-file-name)
(setq file-path buffer-file-name)))
(kill-new (pandoc-convert-file file-path nil "html")))
(kill-new
(pandoc-convert-file
(if (and (eq 4 file-path) buffer-file-name)
buffer-file-name
(read-file-name ""))
nil "html")))

;;;###autoload
(defun copyit-pandoc-export-to-markdown (file-path)
"Convert and Copy `FILE-PATH' file as Markdown."
(interactive "p")
(cond
((null file-path)
(setq file-path (read-file-name "")))
((and (equal 4 file-path) buffer-file-name)
(setq file-path buffer-file-name)))
(kill-new (pandoc-convert-file file-path nil (pandoc-markdown-dialect))))
(kill-new
(pandoc-convert-file
(if (and (eq 4 file-path) buffer-file-name)
buffer-file-name
(read-file-name ""))
nil (pandoc-markdown-dialect))))

(provide 'copyit-pandoc)
;;; copyit-pandoc.el ends here

0 comments on commit d184e88

Please sign in to comment.