Browse Source

Fixed org-mode travis issue

pull/2/head
Josh Wolfe 5 years ago
parent
commit
a9938355e0
  1. 4
      emacs/.emacs.d/build_site.sh
  2. 38
      emacs/.emacs.d/generate-html.el

4
emacs/.emacs.d/build_site.sh

@ -2,11 +2,9 @@ @@ -2,11 +2,9 @@
emacs --version
emacs --batch -f org-version --kill
emacs --daemon
emacsclient -e '(kill-emacs)'
emacs --batch -f org-version --kill
cd emacs/.emacs.d/
emacs --script generate-html.el
emacs --batch -f org-version --kill
cd ../../
mkdir deploy
mv emacs/.emacs.d/README.html deploy/index.html

38
emacs/.emacs.d/generate-html.el

@ -1,5 +1,23 @@ @@ -1,5 +1,23 @@
(require 'package)
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "https://marmalade-repo.org/packages/")
("melpa" . "http://melpa.org/packages/")
("org" . "http://orgmode.org/elpa/")))
(setq package-enable-at-startup nil)
(package-initialize)
;; Bootstrap use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)
;; Use latest org before calling babel
(use-package org
:pin org
:ensure org-plus-contrib)
(require 'ox-html)
(require 'htmlize)
@ -21,8 +39,8 @@ @@ -21,8 +39,8 @@
(defun export-target (target)
(with-current-buffer (find-file-noselect target)
(let ((org-export-headline-levels 10))
(org-html-export-to-html))))
(let ((org-export-headline-levels 10))
(org-html-export-to-html))))
(setq org-html-postamble nil)
(setq org-html-htmlize-output-type 'css)
@ -30,16 +48,16 @@ @@ -30,16 +48,16 @@
(defun add-faces-css (exporter)
"Insert custom inline css to automatically set the
background of code to whatever theme I'm using's background"
background of code to whatever theme I'm using's background"
(setq
org-html-head-extra
(concat
org-html-head-extra
(format "<style type=\"text/css\">\n%s</style>\n"
(with-temp-buffer
(insert-file-contents
(concat (file-name-directory load-file-name) "faces.css"))
(buffer-string))))))
(concat
org-html-head-extra
(format "<style type=\"text/css\">\n%s</style>\n"
(with-temp-buffer
(insert-file-contents
(concat (file-name-directory load-file-name) "faces.css"))
(buffer-string))))))
(add-hook 'org-export-before-processing-hook 'add-faces-css)
(remove-hook 'org-export-before-processing-hook 'wolfe:org-inline-css-hook)

Loading…
Cancel
Save