Skip to content

Instantly share code, notes, and snippets.

@Frozenlock
Created July 1, 2012 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Frozenlock/3026701 to your computer and use it in GitHub Desktop.
Save Frozenlock/3026701 to your computer and use it in GitHub Desktop.
Export org document for Noir webserver
(defun my-org-html-export ()
"Export an org document to a .html file, without the preamble,
postamble and css. Also make sure the image path is compatible with Noir."
(interactive)
(let ((exported-html-file (concat (file-name-sans-extension (buffer-file-name)) ".html"))
(exported-html (org-export-as-html 3 nil nil 'string 'body-only)))
(with-temp-file exported-html-file
(insert exported-html)
(goto-char (point-min))
(replace-string "./" "/"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment