I'm using htmlize
to give Org-mode code blocks syntax highlighting when exported as HTML, but the exported code only captures some of the font-locking.
In particular, for Clojure, it does not capture the extra font-locking from CIDER.
In my init.el
, I have:
(with-eval-after-load 'clojure-mode
(add-hook 'clojure-mode-hook #'cider-mode))
So when I have a CIDER connection open, all clojure-mode
buffers should be getting CIDER font-locking.
When CIDER is off, I see:
When CIDER is on, I see:
But either way, the exported HTML only contains font-locking for the off case:
(when-let [s (seq coll)]
(if (chunked-seq? s)
(let [c (chunk-first s)
(<span style="color: #F0DFAF; font-weight: bold;">when-let</span> [s (seq coll)]
(<span style="color: #F0DFAF; font-weight: bold;">if</span> (chunked-seq? s)
(<span style="color: #F0DFAF; font-weight: bold;">let</span> [c (chunk-first s)
size (int (count c))
b (chunk-buffer size)]
(dotimes [i size]
(chunk-append b (f (.nth c i))))
(<span style="color: #F0DFAF; font-weight: bold;">dotimes</span> [i size]
Why is this? I assume htmlize
works by creating a clojure-mode
buffer, then converting the font-locking to CSS properties, in which case it should capture CIDER's font-locking.