[Export, Drone] Update export.el and .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
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
This commit is contained in:
parent
d776dae8fb
commit
a04de69b10
@ -22,8 +22,7 @@ steps:
|
|||||||
target:
|
target:
|
||||||
from_secret: ssh_target
|
from_secret: ssh_target
|
||||||
source:
|
source:
|
||||||
- !org/config/LICENSE.md
|
- org/config/*
|
||||||
- org/config/*.html
|
|
||||||
strip_components: 2
|
strip_components: 2
|
||||||
username:
|
username:
|
||||||
from_secret: ssh_username
|
from_secret: ssh_username
|
||||||
|
28
export.el
28
export.el
@ -1,22 +1,30 @@
|
|||||||
#!/usr/bin/env -S emacs -Q --script
|
#!/usr/bin/env -S emacs -Q --script
|
||||||
|
|
||||||
(require 'package)
|
(require 'package)
|
||||||
(require 'org)
|
(require 'org)
|
||||||
(require 'ox-html)
|
(require 'ox-html)
|
||||||
|
|
||||||
(setq package-archives '(("melpa" . "https://melpa.org/packages/")))
|
(setq package-archives '(("melpa" . "https://melpa.org/packages/")))
|
||||||
(package-initialize)
|
(package-initialize)
|
||||||
(package-refresh-contents)
|
(package-refresh-contents)
|
||||||
(package-install 'htmlize)
|
(package-install 'htmlize)
|
||||||
|
|
||||||
(setq org-confirm-babel-evaluate nil
|
(setq org-confirm-babel-evaluate nil
|
||||||
org-html-validation-link nil)
|
org-html-validation-link nil)
|
||||||
(let ((files (mapcar #'expand-file-name
|
|
||||||
(file-expand-wildcards "org/config/*.org"))))
|
(defun export-and-clean (directory)
|
||||||
(mapc (lambda (file)
|
(progn (mapc (lambda (file)
|
||||||
(message (format "==========\nExporting %S\n==========" file))
|
(progn (message (concat "====================\n"
|
||||||
|
"Exporting "
|
||||||
|
file
|
||||||
|
"\n"
|
||||||
|
"====================\n"))
|
||||||
(with-current-buffer (find-file file)
|
(with-current-buffer (find-file file)
|
||||||
(org-html-export-to-html)))
|
(org-html-export-to-html))))
|
||||||
files))
|
(directory-files directory t (regexp-quote ".org")))
|
||||||
(let* ((files (mapcar #'expand-file-name
|
|
||||||
(file-expand-wildcards "org/config/*.html~"))))
|
|
||||||
(mapc (lambda (file)
|
(mapc (lambda (file)
|
||||||
(delete-file file))
|
(delete-file file nil))
|
||||||
files))
|
(directory-files directory t (regexp-quote "html~")))))
|
||||||
|
|
||||||
|
(dolist (dir '("org/config/" "org/config/Deprecated/" "org/config/WIP"))
|
||||||
|
(export-and-clean dir))
|
||||||
|
Loading…
Reference in New Issue
Block a user