emacs-config/misc/config-publishing/org-exporter.sh

30 lines
921 B
Bash
Raw Normal View History

2021-01-22 21:01:45 +00:00
#!/usr/bin/env sh
":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-
(setq log-file (format "%s-log.txt" (file-name-base load-file-name)))
2021-01-22 21:01:45 +00:00
(load (expand-file-name "initialise.el" (file-name-directory load-file-name)) nil t)
(initialise)
;;; Actually do the exporting now
(message "[34] Opening config file: %s"
(expand-file-name "config.org" config-root))
(require 'vc) ; need this for modification-time macro
2021-01-24 17:22:18 +00:00
(setq org-mode-hook nil)
(with-current-buffer (find-file-noselect (expand-file-name "config.org" config-root))
2021-01-22 21:01:45 +00:00
(message "[33] Exporting %s" (buffer-file-name))
(org-html-export-to-html))
2021-01-23 14:22:27 +00:00
(publish "config.html" "misc/*.svg")
2021-01-23 14:22:27 +00:00
(make-symbolic-link (expand-file-name "config.html" publish-dir)
(expand-file-name "index.html" publish-dir))
2021-01-22 21:01:45 +00:00
(message "[1;32] Config export complete!")
(setq inhibit-message t)
(kill-emacs exit-code)