githooks

My git server hooks

git clone git://git.lin.moe/githooks.git

 1#!/usr/bin/emacs --script
 2;; Load the necessary packages
 3(require 'org)
 4(require 'ox-html)
 5
 6(setq org-html-html5-fancy t
 7      org-html-doctype "xhtml5"
 8      org-html-validation-link nil
 9      org-export-with-section-numbers nil
10      org-export-with-creator t
11      org-export-with-toc nil
12      org-export-with-email nil)
13
14
15(defun compile-org-file ()
16  (interactive)
17  (let ((org-document-content "")
18        this-read)
19    (while (setq this-read (ignore-errors
20                             (read-from-minibuffer "")))
21      (setq org-document-content (concat org-document-content "\n" this-read)))
22
23    (with-temp-buffer
24      (org-mode)
25      (insert org-document-content)
26      (org-html-export-as-html nil nil nil t)
27      (princ (buffer-string)))))
28
29(compile-org-file)
30
31;; Exit Emacs gracefully
32(if (fboundp 'emacs-batch-shutdown)
33    (emacs-batch-shutdown)
34  (kill-emacs))
35