Modifying Minted background is easy if my output from Org is LaTeX.
\definecolor{LightGray}{gray}{0.9}
\begin{minted}
[
frame=lines,
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
linenos
]
{python}
(code)
\end{minted}
Also, for Minted I understand that I "have to set the background color [myself]. This is not the default because it is really printer unfriendly." That's just fine, as I need no printouts. But IIUC HTML export does not go through LaTeX. Org exports directly to HTML (is that right?).
How do I change Org's HTML code background?
As it is, the syntax highlighting is close to unreadable.
If I use the .emacs
(set-foreground-color "white")
(set-background-color "black")
(defun my-org-inline-css-hook (exporter)
"Insert custom inline css"
(when (eq exporter 'html)
(let ((my-pre-bg (face-background 'default)))
(setq org-html-head-include-default-style nil)
(setq org-html-head
(format "<style type=\"text/css\">\n pre.src { background-color: %s;}</style>\n" my-pre-bg)))))
(add-hook 'org-export-before-processing-hook 'my-org-inline-css-hook)
the HTML code output does get a dark background, but other colors vanish. Do you see what is happening?
pre.src { background-color: %s; color: purple; }
to see if the other text turns purple. If it does, you could change those to white, or to(face-foreground 'default)
print
andrange
) and make the rest pop.#+HTML_HEAD_EXTRA: <style> pre.src { background-color: #626262; }</style>
seems to work in the sense that code blocks are readable withouth anything hiding away in the background. See CSS Support in the manual.