[CI] Add CI script, add export script

Drone script calls new `export.el' script written in Emacs Lisp to
export all org files to HTML files.

HTML files should then be uploaded to a remote server with SCP
This commit is contained in:
2020-09-03 10:44:27 +02:00
parent d34d4b0550
commit a81b314a9e
2 changed files with 56 additions and 0 deletions

21
export.el Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/emacs --script
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)
(package-install 'htmlize)
(package-install 's)
(require 's)
(setq org-confirm-babel-evaluate nil)
(let* ((files (mapcar #'expand-file-name
(file-expand-wildcards "org/config/*.org"))))
(mapc (lambda (file)
(message (format "==========\nExporting %S\n==========" file))
(with-current-buffer (find-file file)
(org-html-export-to-html)))
files))
(let* ((files (mapcar #'expand-file-name
(file-expand-wildcards "org/config/*.html~"))))
(mapc (lambda (file)
(delete-file file))
files))