1#!/usr/bin/emacs --script2;; Load the necessary packages3(require 'org)4(require 'ox-html)56(setq org-html-html5-fancy t7 org-html-doctype "xhtml5"8 org-html-validation-link nil9 org-export-with-section-numbers nil10 org-export-with-creator t11 org-export-with-toc nil12 org-export-with-email nil)131415(defun compile-org-file ()16 (interactive)17 (let ((org-document-content "")18 this-read)19 (while (setq this-read (ignore-errors20 (read-from-minibuffer "")))21 (setq org-document-content (concat org-document-content "\n" this-read)))2223 (with-temp-buffer24 (org-mode)25 (insert org-document-content)26 (org-html-export-as-html nil nil nil t)27 (princ (buffer-string)))))2829(compile-org-file)3031;; Exit Emacs gracefully32(if (fboundp 'emacs-batch-shutdown)33 (emacs-batch-shutdown)34 (kill-emacs))35