I'm having issues achieving any syntax highlighting in the results of the following command:
emacs nix.org --batch -f org-html-export-to-html --kill
I know this question has been asked a few times already in various forms, but none of the advertised solutions I've found have worked for me (linked below).
- spacemacs (via emacs 25.3) on the
developbranch, current as of 2018 January 29
htmlize-20171017.141as a dependency of the
- Attempting to highlight source blocks of
What I'm Seeing
Naively performing the command above gives many lines of:
Cannot fontify src block (htmlize.el >= 1.34 required)
I tried copy-pasting the
htmlize.el found in my
.emacs.d/elpa/.. and refering to it manually:
emacs nix.org --batch -l htmlize.el -f org-html-export-to-html --kill
...and this makes the "Cannot find..." errors go away, but the output is still not highlighted properly. Actually, the
lisp block does have one of its keywords bolded, but nothing else looks right. Similar hacks to manually include lisp code from say
haskell-mode can achieve bold/italics-only highlighting, which is not what I want.
-q, which ignores all user config (to speed up start-up, I'm assuming). This seems to have the effect of ignoring all the Emacs packages I have installed (via spacemacs), and so the batch process can't see
htmlize or any of my major modes to achieve proper colouring.
- Is there a way for me to tell a batch'd emacs process to respect my config and see all the packages I have? (this might tank each run of it though)
- Is there something else simple that I'm missing to achieve this highlighting properly?
My goal is to only commit my
.org files for a blog, and have my server generate each
.html properly on-the-fly during a deploy. I could just generate the nice
.html files on my own machine and commit those, but I really don't want to do that.