This is part of the Emacs Starter Kit.
This file is used to publish the starter kit documentation to .html
in the doc/
directory.
This code defines the starter-kit-project
which is used to publish
the documentation for the Starter Kit to html.
(unless (boundp 'org-publish-project-alist)
(setq org-publish-project-alist nil))
(let* ((this-dir (file-name-directory (or load-file-name buffer-file-name)))
(starter-kit-dir this-dir)
(org-export-htmlize-output-type 'css)
(load-path (cons (expand-file-name "elpa" this-dir) load-path))
(package-archives '(("original" . "http://tromey.com/elpa/"))))
;; load the basic starter kit
(org-babel-load-file (expand-file-name "starter-kit.org" this-dir))
;; load up htmlize
(package-initialize)
(unless (functionp 'htmlize)
(starter-kit-install-if-needed 'htmlize))
(require 'htmlize)
(org-html-htmlize-generate-css)
;; define the org-publish-project for the starter kit
(add-to-list
'org-publish-project-alist
`("starter-kit-documentation"
:publishing-function org-html-publish-to-html
:base-directory ,this-dir
:base-extension "org"
:style "<link rel=\"stylesheet\" href=\"emacs.css\" type=\"text/css\"/>
<style type=\"text/css\">
pre{background:#232323; color:#E6E1DC;}
code{font-size:10pt; color:#353535;}
.outline-text-2{margin-left: 1em;}
.outline-text-3{margin-left: 2em;}
.outline-text-3{margin-left: 3em;}
</style>"
:publishing-directory ,(expand-file-name "doc" this-dir)
:index-filename "starter-kit.org"
:html-postamble nil))
;; publish the starter kit
(org-publish-project "starter-kit-documentation" 'force)
;; copy starter-kit.html to index.html
(copy-file (expand-file-name "starter-kit.html" (expand-file-name "doc" this-dir))
(expand-file-name "index.html" (expand-file-name "doc" this-dir)) t))