diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2015-11-22 18:06:36 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2015-11-22 18:26:00 +0000 |
commit | e9b3b401401dde1ec0cbd65d3ddbaf20114dd09d (patch) | |
tree | 815994c69d87544c18fc3224e71f230466f4641f | |
parent | f345d731ad2ac455ccba1ad5fd463278637f9ff2 (diff) | |
download | dotfiles-e9b3b401401dde1ec0cbd65d3ddbaf20114dd09d.tar.gz |
update Org publishing setup for athena
-rw-r--r-- | .emacs.d/init-org.el | 54 | ||||
-rwxr-xr-x | bin/doc_post_receive_hook | 54 |
2 files changed, 96 insertions, 12 deletions
diff --git a/.emacs.d/init-org.el b/.emacs.d/init-org.el index 1ee3b1dd..35e49bee 100644 --- a/.emacs.d/init-org.el +++ b/.emacs.d/init-org.el @@ -331,7 +331,7 @@ spaces in it and to remove any colons." ((org-agenda-start-with-log-mode nil) ;; (org-agenda-tag-filter-preset '("-Sariul")) (org-agenda-start-with-follow-mode nil)) - ("~/lib/fm/dionysus/agenda.html" "/ma:html/day/index.html")) + ("/var/www/spw/org/agenda.html")) ("A" "Daily planning view" ((agenda "day" ((org-agenda-ndays 1) (org-agenda-time-grid nil) @@ -347,7 +347,9 @@ spaces in it and to remove any colons." (org-agenda-entry-types '(:timestamp :sexp)) (org-agenda-show-all-dates nil) (org-agenda-overriding-header "Coming up") - (org-agenda-files (quote ("~/doc/org/diary.org"))))))) + (org-agenda-files (quote ("~/doc/org/diary.org")))))) + nil + ("/var/www/spw/org/full.html")) ("#" "Weekly review view" ((todo "WAITING" ((org-agenda-todo-ignore-scheduled t) (org-agenda-todo-ignore-deadlines nil) @@ -378,7 +380,7 @@ spaces in it and to remove any colons." (org-agenda-show-all-dates nil) (org-agenda-overriding-header "Sean's diary for the next six months") (org-agenda-files (quote ("~/doc/org/diary.org")))) - ("~/lib/fm/dionysus/diary.html" "/ma:html/cal/index.html")))) + ("/var/www/spw/org/diary.html")))) ;;; sensible automatic tag filtering @@ -707,7 +709,7 @@ spaces in it and to remove any colons." ;; following is purely so that we can export my Org files to ;; the desktop, not just into ~/doc/org (add-to-list 'org-publish-project-alist - '("spw-doc" + '("doc" :base-directory "~/doc/org" :base-extension "org" :publishing-function org-latex-publish-to-pdf @@ -726,7 +728,7 @@ spaces in it and to remove any colons." :base-directory "~/doc/org/philos" :base-extension "org" :recursive nil - :publishing-directory "~/lib/fm/Philos notes" + :publishing-directory "~/lib/fm/dionysus/Philos notes" :publishing-function org-html-publish-to-html :auto-sitemap t :sitemap-filename "index.html" @@ -741,19 +743,39 @@ spaces in it and to remove any colons." "</style>"))) (add-to-list 'org-publish-project-alist - '("spw-wiki" + `("org-dav" :base-directory "~/doc/org" :base-extension "org" :recursive nil - :publishing-directory "/meta/www/s/spw/wiki" + :publishing-directory "~/lib/fm/dionysus/Org docs" + :publishing-function org-html-publish-to-html + :auto-sitemap t + :sitemap-filename "123Index.html" + :sitemap-title "Sean's ~/doc" + :html-head ,(concat + "<style type=\"text/css\">" + (when (f-exists? "~/doc/org/worg.css") + (with-temp-buffer + (insert-file-contents "~/doc/org/worg.css") + (buffer-string))) + "</style>") + :html-head-include-default-style nil + :table-of-contents t)) + +(add-to-list 'org-publish-project-alist + '("org-web" + :base-directory "~/doc/org" + :base-extension "org" + :recursive nil + :publishing-directory "/var/www/spw/org" :publishing-function org-html-publish-to-html :auto-sitemap t :sitemap-filename "index.html" :sitemap-title "Sean's ~/doc" - :html-head "<link rel=\"stylesheet\" title=\"Worg\" href=\"/inc/worg.css\" type=\"text/css\"> -<link rel=\"alternate stylesheet\" title=\"Zenburn\" href=\"/inc/worg-zenburn.css\" type=\"text/css\"> -<link rel=\"icon\" href=\"/inc/org-mode-unicorn.ico\" type=\"image/vnd.microsoft.icon\" /> -<link rel=\"SHORTCUT ICON\" href=\"https://spw.sdf.org/inc/org-mode-unicorn.ico\" type=\"image/vnd.microsoft.icon\" />" + :html-head "<link rel=\"stylesheet\" title=\"Worg\" href=\"/org/worg.css\" type=\"text/css\"> +<link rel=\"alternate stylesheet\" title=\"Zenburn\" href=\"/org/worg-zenburn.css\" type=\"text/css\"> +<link rel=\"icon\" href=\"/org/org-mode-unicorn.ico\" type=\"image/vnd.microsoft.icon\" /> +<link rel=\"SHORTCUT ICON\" href=\"https://spwhitton.name/org/org-mode-unicorn.ico\" type=\"image/vnd.microsoft.icon\" />" :html-preamble "<script type=\"text/javascript\"> document.addEventListener('DOMContentLoaded',function() { document.getElementById(\"table-of-contents\").onclick = function() { @@ -762,10 +784,18 @@ spaces in it and to remove any colons." } }); </script> -<p><a href=\"/wiki\">Personal wiki index</a> · <a href=\"/wiki/agenda.html\">Daily agenda view</a> · <a href=\"/wiki/cal.html\">Three month diary</a></p>" +<p><a href=\"/org\">Personal wiki index</a> · <a href=\"/org/agenda.html\">Daily agenda view</a> · <a href=\"/org/full.html\">Full agenda view</a> · <a href=\"/org/diary.html\">Three month diary</a></p>" :html-head-include-default-style nil :table-of-contents t)) +(add-to-list 'org-publish-project-alist + '("org-web-static" + :base-directory "~/doc/org" + :base-extension "css\\|ico" + :recursive nil + :publishing-directory "/var/www/spw/org" + :publishing-function org-publish-attachment)) + (defun spw/cleanup-org-pdfs () (interactive) (dolist (file (f-glob "~/doc/org/*.pdf")) diff --git a/bin/doc_post_receive_hook b/bin/doc_post_receive_hook new file mode 100755 index 00000000..724090f2 --- /dev/null +++ b/bin/doc_post_receive_hook @@ -0,0 +1,54 @@ +#!/bin/sh + +HOME=/home/swhitton + +. $HOME/.shenv + +# 1. prepare the union mount + +if ! [ -d "$HOME/local/src/org-publish/doc" ]; then + mkdir -p $HOME/local/src/org-publish + git clone /home/git/doc.git $HOME/local/src/org-publish/doc +else + cd $HOME/local/src/org-publish/doc + git pull -f +fi +if ! mount | grep "lib/fm" >/dev/null; then + mount $HOME/lib/fm +fi +mkdir -p /var/www/spw/org + +#TEMP=$(mktemp -d) +if [ -e "/tmp/org-work" ]; then + # we cannot use our own `mktemp -d' because Org hardcodes paths to + # source files in its timestamps cache + echo "another instance of the Org publishing script is running or crashed" + exit +else + mkdir /tmp/org-work + TEMP="/tmp/org-work" +fi +unionfs-fuse $HOME/local/src/org-publish=RW:$HOME=RW $TEMP + +# 2. change to the union mount and run Emacs + +HOME=$TEMP +export HOME +lisp=$(cat <<EOF +(progn + (org-batch-store-agenda-views) + (org-publish-project "org-web") + (org-publish-project "org-web-static") + (org-publish-project "org-dav") + (org-publish-project "philos")) +EOF + ) +chronic emacs -batch \ + -l $HOME/.emacs.d/init.el \ + -l $HOME/.emacs.d/init-org.el \ + -eval "$lisp" + +# 3. cleanup + +fusermount -u $TEMP +rmdir $TEMP |