#!/usr/bin/emacs --script (require 'org) (require 'ox) (require 'ox-html) (defun org-to-html () (let* ((org (with-temp-buffer (progn (condition-case nil (let (line) (while (setq line (read-from-minibuffer "")) (insert line) (insert "\n"))) (error nil)) (buffer-string)))) (html (with-temp-buffer (let ((org-export-with-toc nil)) (insert org) (org-export-to-buffer 'html (current-buffer) nil nil nil t) (buffer-string))))) (prin1 html))) (org-to-html)