[Emacs] Use theme background color in org-export

This commit is contained in:
Ivan Malison 2016-10-19 16:56:51 -07:00
parent be9a5b3bb1
commit 206ffa513e
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -2982,6 +2982,26 @@ Intero seems to be causing hangs, so it has been disabled
;; blame. ;; blame.
)) ))
#+END_SRC #+END_SRC
**** Correct BG color for org-export
#+BEGIN_SRC emacs-lisp
(use-package org
:config
(progn
(defun imalison:org-inline-css-hook (exporter)
"Insert custom inline css to automatically set the
background of code to whatever theme I'm using's background"
(when (eq exporter 'html)
(let* ((my-pre-bg (face-background 'default))
(my-pre-fg (face-foreground 'default)))
(setq
org-html-head-extra
(concat
org-html-head-extra
(format "<style type=\"text/css\">\n pre.src {background-color: %s; color: %s;}</style>\n"
my-pre-bg my-pre-fg))))))
(add-hook 'org-export-before-processing-hook 'imalison:org-inline-css-hook)))
#+END_SRC
**** org-projectile **** org-projectile
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(imalison:use-package org-projectile (imalison:use-package org-projectile