Export pdf version of config too

This commit is contained in:
TEC 2021-01-28 16:39:19 +08:00
parent df2ce42fdc
commit 7401330d93
Signed by: tec
GPG Key ID: 779591AFDB81F06C
5 changed files with 49 additions and 8 deletions

View File

@ -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'}}

View File

@ -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"))

View File

@ -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")

View File

@ -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)

View File

@ -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