From 69fa53c877fe7f278b3ad455c96c81296afc95ce Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 5 Nov 2020 15:53:28 +0100 Subject: [PATCH] Modified script for colorized html --- {src => docs}/config.el | 25 ++++--------------------- src/create_doc.sh | 11 +++-------- 2 files changed, 7 insertions(+), 29 deletions(-) rename {src => docs}/config.el (77%) diff --git a/src/config.el b/docs/config.el similarity index 77% rename from src/config.el rename to docs/config.el index 9395d1d..2bf16e4 100755 --- a/src/config.el +++ b/docs/config.el @@ -1,6 +1,8 @@ -(require 'org) -(require 'font-lock) +;; Thanks to Tobias's answer on Emacs Stack Exchange: +;; https://emacs.stackexchange.com/questions/38437/org-mode-batch-export-missing-syntax-highlighting +(package-initialize) +(require 'font-lock) (require 'subr-x) ;; for `when-let' (unless (boundp 'maximal-integer) @@ -66,22 +68,3 @@ with class 'color and highest min-color value." (or val 'unspecified))) (advice-add 'face-attribute :override #'my-face-attribute) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Debugging: -(defmacro print-args-and-ret (fun) - "Prepare FUN for printing args and return value." - `(advice-add (quote ,fun) :around - (lambda (oldfun &rest args) - (let ((ret (apply oldfun args))) - (message ,(concat "Calling " (symbol-name fun) " with args %S returns %S.") args ret) - ret)) - '((name "print-args-and-ret")))) - -; (print-args-and-ret htmlize-faces-in-buffer) -; (print-args-and-ret htmlize-get-override-fstruct) -; (print-args-and-ret htmlize-face-to-fstruct) -; (print-args-and-ret htmlize-attrlist-to-fstruct) -; (print-args-and-ret face-foreground) -; (print-args-and-ret face-background) -; (print-args-and-ret face-attribute) diff --git a/src/create_doc.sh b/src/create_doc.sh index 5613c26..ea002d9 100755 --- a/src/create_doc.sh +++ b/src/create_doc.sh @@ -1,13 +1,8 @@ #!/bin/bash INPUT=$1 -#emacs merged_qmckl.org --batch --eval "(require 'htmlize)" -f org-html-export-to-html --kill -emacs \ - $INPUT \ - --batch \ - --eval "(package-initialize)" \ - -f org-html-export-to-html \ - --kill -mv *.html ../docs +emacs --batch --load ../docs/config.el $INPUT -f org-html-export-to-html + +mv index.html ../docs