diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0b3a4dc..3bad971 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -54,12 +54,17 @@ jobs: - name: Install Doom run: ~/.emacs.d/bin/doom install --no-env --no-fonts + - name: Install LaTeX compiler chain + run: | + git clone https://github.com/tecosaur/BMC.git ~/texmf/tex/latex/bmc + sudo apt install texlive-base texlive-latex-recommended texlive-fonts-extra latexmk + - name: Export config run: ~/.config/doom/misc/config-publishing/publish.sh - # - name: Debug failure over SSH (tmate) - # if: ${{ failure() }} - # uses: mxschmitt/action-tmate@v3.1 + - name: Debug failure over SSH (tmate) + if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3.1 - name: Deploy if: ${{ github.event_name != 'pull_request'}} diff --git a/misc/config-publishing/initialise.el b/misc/config-publishing/initialise.el index 47016ac..fda9680 100644 --- a/misc/config-publishing/initialise.el +++ b/misc/config-publishing/initialise.el @@ -68,6 +68,8 @@ ;; Avoid error: file-missing "Opening directory" "No such file or directory" "~/org/roam" (setq org-roam-directory "~") + (advice-add 'org-roam-mode :override #'ignore) + (advice-add 'org-roam-db-build-cache :override #'ignore) (if full (load (expand-file-name "~/.emacs.d/init.el")) diff --git a/misc/config-publishing/org-exporter.sh b/misc/config-publishing/org-html.sh similarity index 83% rename from misc/config-publishing/org-exporter.sh rename to misc/config-publishing/org-html.sh index f4be17b..2f4dbaa 100755 --- a/misc/config-publishing/org-exporter.sh +++ b/misc/config-publishing/org-html.sh @@ -14,14 +14,14 @@ (require 'vc) ; need this for modification-time macro (require 'org) -(setq org-mode-hook nil) (with-temp-buffer - (let ((buffer-file-name (expand-file-name "config.org" config-root)) + (let ((default-directory config-root) + (buffer-file-name (expand-file-name "config.org" config-root)) (org-export-coding-system org-html-coding-system) - org-mode-hook) + org-mode-hook org-load-hook) (insert-file-contents (expand-file-name "config.org" config-root)) (message "[33] Exporting %s" (buffer-file-name)) - (org-export-to-file 'html (expand-file-name "config.html" config-root)))) + (org-html-export-to-html))) (publish "config.html" "misc/*.svg") diff --git a/misc/config-publishing/org-pdf.sh b/misc/config-publishing/org-pdf.sh new file mode 100755 index 0000000..457b1d3 --- /dev/null +++ b/misc/config-publishing/org-pdf.sh @@ -0,0 +1,32 @@ +#!/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))) + +(load (expand-file-name "initialise.el" (file-name-directory load-file-name)) nil t) +(initialise t) + +;;; 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 +(require 'org) + +(setq org-mode-hook nil) +(with-temp-buffer + (let ((default-directory config-root) + (buffer-file-name (expand-file-name "config.org" config-root)) + (org-export-coding-system org-html-coding-system) + org-mode-hook org-load-hook) + (insert-file-contents (expand-file-name "config.org" config-root)) + (message "[33] Exporting %s" (buffer-file-name)) + (org-latex-export-to-pdf))) + +(publish "config.pdf") + +(message "[1;32] Config export complete!") + +(setq inhibit-message t) +(kill-emacs exit-code) diff --git a/misc/config-publishing/publish.sh b/misc/config-publishing/publish.sh index cd434bd..17244fd 100755 --- a/misc/config-publishing/publish.sh +++ b/misc/config-publishing/publish.sh @@ -62,7 +62,9 @@ (wait-for-script "htmlize.sh") -(wait-for-script "org-exporter.sh") +(wait-for-script "org-pdf.sh") + +(wait-for-script "org-html.sh") ;;; Status info