Browse Source

[Export, Drone] Update export.el and .drone.yml

export.el:
Now export all org files in specified directories
Code a bit cleaner

.drone.yml:
Send all the content of org/config to the remote server
master
parent
commit
a04de69b10
Signed by: phundrak GPG Key ID: BD7789E705CB8DCA
  1. 3
      .drone.yml
  2. 32
      export.el

3
.drone.yml

@ -22,8 +22,7 @@ steps:
target:
from_secret: ssh_target
source:
- !org/config/LICENSE.md
- org/config/*.html
- org/config/*
strip_components: 2
username:
from_secret: ssh_username

32
export.el

@ -1,22 +1,30 @@
#!/usr/bin/env -S emacs -Q --script
(require 'package)
(require 'org)
(require 'ox-html)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")))
(package-initialize)
(package-refresh-contents)
(package-install 'htmlize)
(setq org-confirm-babel-evaluate nil
org-html-validation-link 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))
(defun export-and-clean (directory)
(progn (mapc (lambda (file)
(progn (message (concat "====================\n"
"Exporting "
file
"\n"
"====================\n"))
(with-current-buffer (find-file file)
(org-html-export-to-html))))
(directory-files directory t (regexp-quote ".org")))
(mapc (lambda (file)
(delete-file file nil))
(directory-files directory t (regexp-quote "html~")))))
(dolist (dir '("org/config/" "org/config/Deprecated/" "org/config/WIP"))
(export-and-clean dir))

Loading…
Cancel
Save