From 0c1c736bae53fd4c79df601dd2561ddf8e50bbaf Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 2 Oct 2013 00:02:08 +0200 Subject: Update build script --- site/Makefile | 11 ++-- site/project.el | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 160 insertions(+), 3 deletions(-) create mode 100644 site/project.el (limited to 'site') diff --git a/site/Makefile b/site/Makefile index 0b628e7..bfdaa73 100644 --- a/site/Makefile +++ b/site/Makefile @@ -1,7 +1,12 @@ -export: +all: + +clean: + rm -rf _publish + +export: clean emacs -L ~/.emacs.d/vendor-lisp/org/lisp \ - -batch -l project.el \ + -L ~/.emacs.d/vendor-lisp/org/contrib/lisp -batch -l project.el \ -f org-publish-all -publish: +publish: export rsync -avuz --exclude=*~ _publish/ ryuslash.org:public_html/orgweb diff --git a/site/project.el b/site/project.el new file mode 100644 index 0000000..6e0c520 --- /dev/null +++ b/site/project.el @@ -0,0 +1,152 @@ +(require 'org-publish) +;; (require 'ox-html) + +;; (defun org-html-template (contents info) +;; "Return complete document string after HTML conversion. +;; CONTENTS is the transcoded contents string. INFO is a plist +;; holding export options." +;; (concat +;; (format +;; (or (and (stringp org-html-xml-declaration) +;; org-html-xml-declaration) +;; (cdr (assoc (plist-get info :html-extension) +;; org-html-xml-declaration)) +;; (cdr (assoc "html" org-html-xml-declaration)) + +;; "") +;; (or (and org-html-coding-system +;; (fboundp 'coding-system-get) +;; (coding-system-get org-html-coding-system 'mime-charset)) +;; "iso-8859-1")) +;; "\n" +;; (plist-get info :html-doctype) +;; "\n" +;; (format "\n" +;; (plist-get info :language) (plist-get info :language)) +;; "\n" +;; (org-html--build-meta-info info) +;; (org-html--build-head info) +;; (org-html--build-mathjax-config info) +;; "\n" +;; "\n" +;; (let ((link-up (org-trim (plist-get info :html-link-up))) +;; (link-home (org-trim (plist-get info :html-link-home)))) +;; (unless (and (string= link-up "") (string= link-up "")) +;; (format org-html-home/up-format +;; (or link-up link-home) +;; (or link-home link-up)))) +;; ;; Preamble. +;; (org-html--build-pre/postamble 'preamble info) +;; ;; Document contents. +;; (format "<%s class=\"%s\">\n" +;; (nth 1 (assq 'content org-html-divs)) +;; (nth 2 (assq 'content org-html-divs))) +;; ;; Document title. +;; "
\n
\n" +;; (let ((title (plist-get info :title))) +;; (format "%s\n" (org-export-data (or title "") info))) +;; "
\n
\n" +;; contents +;; (format "") +;; (format "\n" +;; (nth 1 (assq 'content org-html-divs))) +;; ;; Postamble. +;; "
\n" +;; (org-html--build-pre/postamble 'postamble info) +;; "
\n" +;; ;; Closing document. +;; "\n")) + +;; (defun org-html--tags (tags) +;; "Format TAGS into HTML." +;; (when tags +;; (format "%s" +;; (mapconcat +;; (lambda (tag) +;; (format "%s" +;; (concat org-html-tag-class-prefix +;; (org-html-fix-class-name tag)) +;; tag)) +;; tags " ")))) + +;; (defun org-html-inner-template (contents info) +;; "Return body of document string after HTML conversion. +;; CONTENTS is the transcoded contents string. INFO is a plist +;; holding export options." +;; (let ((depth (plist-get info :with-toc))) +;; (concat +;; (when depth +;; (concat +;; "
\n" +;; "
\n" +;; ;; Table of contents. +;; (when depth (org-html-toc depth info)) +;; "
\n" +;; "
\n")) +;; ;; Document contents. +;; contents +;; (when depth +;; "
\n
") +;; ;; Footnotes section. +;; (org-html-footnote-section info) +;; ;; Bibliography. +;; (org-html-bibliography)))) + +;; (defun org-html-toc (depth info) +;; "Build a table of contents. +;; DEPTH is an integer specifying the depth of the table. INFO is a +;; plist used as a communication channel. Return the table of +;; contents as a string, or nil if it is empty." +;; (let ((toc-entries +;; (mapcar (lambda (headline) +;; (cons (org-html--format-toc-headline headline info) +;; (org-export-get-relative-level headline info))) +;; (org-export-collect-headlines info depth)))) +;; (when toc-entries (org-html--toc-text toc-entries)))) + +;; (defun org-html--toc-text (toc-entries) +;; "Return innards of a table of contents, as a string. +;; TOC-ENTRIES is an alist where key is an entry title, as a string, +;; and value is its relative level, as an integer." +;; (let* ((prev-level (1- (cdar toc-entries))) +;; (start-level prev-level)) +;; (concat +;; (mapconcat +;; (lambda (entry) +;; (let ((headline (car entry)) +;; (level (cdr entry))) +;; (concat +;; (let* ((cnt (- level prev-level)) +;; (times (if (> cnt 0) (1- cnt) (- cnt))) +;; rtn) +;; (setq prev-level level) +;; (concat +;; (org-html--make-string +;; times (cond ((> cnt 0) "\n\n"))) +;; (if (> cnt 0) "\n\n")))) + +(setq org-html-head-include-scripts nil + org-html-validation-link nil + org-publish-use-timestamps-flag nil + org-publish-project-alist + '(("oni-files" + :base-directory "./" + :publishing-directory "_publish/" + :recursive nil + :base-extension "css\\|png" + :publishing-function org-publish-attachment) + ("org" + :base-directory "./" + :publishing-directory "_publish/" + :recursive t + :base-extension "org" + :publishing-function org-html-publish-to-html + :section-numbers nil + :table-of-contents 1 + :html-doctype "" + :html-head "" + :html-link-home "http://ryuslash.org"))) -- cgit v1.2.3-54-g00ecf