2021-01-22 21:01:45 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-
|
|
|
|
|
2021-03-28 07:55:47 +00:00
|
|
|
(setq log-file (expand-file-name (format "%s-log.txt" (file-name-base load-file-name))))
|
2021-01-23 14:23:24 +00:00
|
|
|
|
2021-01-22 21:01:45 +00:00
|
|
|
(load (expand-file-name "initialise.el" (file-name-directory load-file-name)) nil t)
|
2022-12-09 12:02:49 +00:00
|
|
|
(initialise 'full)
|
2021-01-22 21:01:45 +00:00
|
|
|
|
|
|
|
;;; 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-25 02:19:59 +00:00
|
|
|
(require 'org)
|
2023-01-22 15:39:18 +00:00
|
|
|
(require 'org-persist)
|
|
|
|
(remove-hook 'kill-emacs-hook #'org-persist-gc)
|
2021-01-29 15:25:26 +00:00
|
|
|
(require 'ox-html)
|
2021-01-22 21:01:45 +00:00
|
|
|
|
2021-09-08 09:28:08 +00:00
|
|
|
;; For some faces
|
|
|
|
(require 'highlight-numbers)
|
|
|
|
(require 'highlight-quoted)
|
|
|
|
(require 'rainbow-delimiters)
|
|
|
|
|
2021-01-25 02:19:59 +00:00
|
|
|
(with-temp-buffer
|
2021-01-28 08:39:19 +00:00
|
|
|
(let ((default-directory config-root)
|
|
|
|
(buffer-file-name (expand-file-name "config.org" config-root))
|
2022-12-09 12:02:49 +00:00
|
|
|
(org-export-coding-system 'utf-8)
|
|
|
|
(org-export-with-broken-links t)
|
2021-01-28 08:39:19 +00:00
|
|
|
org-mode-hook org-load-hook)
|
2021-01-25 02:19:59 +00:00
|
|
|
(insert-file-contents (expand-file-name "config.org" config-root))
|
2021-01-30 20:49:31 +00:00
|
|
|
(goto-char (point-max))
|
|
|
|
(insert (shell-command-to-string (expand-file-name "./gen-org-snippets.sh" script-root)))
|
2021-01-25 02:19:59 +00:00
|
|
|
(message "[33] Exporting %s" (buffer-file-name))
|
2021-03-05 18:23:53 +00:00
|
|
|
(org-mode)
|
2021-01-28 08:39:19 +00:00
|
|
|
(org-html-export-to-html)))
|
2021-01-22 21:01:45 +00:00
|
|
|
|
2021-03-26 10:31:15 +00:00
|
|
|
(publish "config.html" "misc/*.svg" "misc/splash-images/*")
|
2021-01-23 12:14:39 +00:00
|
|
|
|
2021-01-23 14:22:27 +00:00
|
|
|
(make-symbolic-link (expand-file-name "config.html" publish-dir)
|
2021-01-29 15:25:26 +00:00
|
|
|
(expand-file-name "index.html" publish-dir) t)
|
2021-01-23 12:14:39 +00:00
|
|
|
|
2021-01-22 21:01:45 +00:00
|
|
|
(message "[1;32] Config export complete!")
|
|
|
|
|
|
|
|
(setq inhibit-message t)
|
|
|
|
(kill-emacs exit-code)
|