This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 "./" "/")))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun insert-in-last-ielm-eval (string) | |
(when (search-backward "ELISP>" nil t) | |
(backward-char 1) | |
(newline) | |
(insert string) | |
(goto-char (point-max)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn spit-to-zip | |
"Put the content in filename and zip it into zip-filename. Accept | |
one or more filename/content." | |
[zip-filename filename content & others] | |
(with-open [zip (java.util.zip.ZipOutputStream. | |
(clojure.java.io/output-stream zip-filename))] | |
(let [add-entry (fn [name cont remain] | |
(-> zip (.putNextEntry (java.util.zip.ZipEntry. name))) | |
(doto (java.io.PrintStream. zip true) | |
(.println content)) |
NewerOlder