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).
My Environment
- spacemacs (via emacs 25.3) on the
develop
branch, current as of 2018 January 29 htmlize-20171017.141
as a dependency of theorg
layer- Attempting to highlight source blocks of
haskell
,lisp
,yaml
, andnix
modes
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.
--batch
implies -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.
Questions
- 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.
Thanks!
Related
- https://stackoverflow.com/questions/10642888/syntax-highlighting-within-begin-src-block-in-emacs-orgmode-not-working
- https://stackoverflow.com/questions/24082430/org-mode-no-syntax-highlighting-in-exported-html-page
- https://stackoverflow.com/questions/31106417/no-syntax-highlighting-with-org-html-export-to-html-when-executing-with-systemd
-l htmlize.el
by-f package-initialize
. Does that help?