Skip to content

Instantly share code, notes, and snippets.

@dchest
Created November 14, 2011 10:08
Show Gist options
  • Select an option

  • Save dchest/1363656 to your computer and use it in GitHub Desktop.

Select an option

Save dchest/1363656 to your computer and use it in GitHub Desktop.
rst-to-html (emacs)
(defun rst-to-html ()
"Convert current file from reStructuredText to HTML, outputting to file.html."
(interactive)
(when (not (stringp (buffer-file-name)))
(error "No file name"))
(message "Running...")
(shell-command
(concat "rst2html -d "
(shell-quote-argument (buffer-file-name))
" "
(shell-quote-argument (concat
(file-name-sans-extension (buffer-file-name))
".html")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment