3

I have some code snippets within an org file:

#+BEGIN_SRC python
print 42
#+END_SRC

When exporting to HTML (org-export-dispatch), the syntax highlighting seems to follow my current theme, but the background of the code block remains pure white (and as I'm using a dark theme, makes the code quite unreadable).

From what I've seen htmlize.el (https://github.com/hniksic/emacs-htmlize) is supposed to help. I can call htmlize-buffer and indeed I get a page that has the right background colour, but it's just a "raw" copy of my buffer and not a proper Org export.

How should I go about to make org-export-dispatch use htmlize only for the source code blocks ?

FWIW I'm using Emacs 24.5.1

  • I had a look at https://emacs.stackexchange.com/questions/3374/set-the-background-of-org-exported-code-blocks-according-to-theme before asking this question. The end result does fit the bill, but it doesn't use htmlize for the background, which I think (or thought ?) is possible. – Valentin Schneider May 23 '18 at 08:52

0 Answers0