[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] running some elisp code when exporting a given file
From: |
Alan Schmitt |
Subject: |
[O] running some elisp code when exporting a given file |
Date: |
Thu, 05 Sep 2013 09:58:15 +0200 |
User-agent: |
mu4e 0.9.9.5; emacs 24.3.1 |
Hello,
I would like to inline a css when exporting a file to html, but I don't
know how to tell org-mode to set the variable org-html-head from within
the file.
Here is what I tried: I added the following block at the beginning of my
file:
--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC emacs-lisp :exports none
(set (make-local-variable 'org-html-head) (concat
"<style type=\"text/css\">\n"
"<!--/*--><![CDATA[/*><!--*/\n"
(with-temp-buffer
(insert-file-contents "style.css")
(buffer-string))
"/*]]>*/-->\n"
"</style>\n"))
#+END_SRC
--8<---------------cut here---------------end--------------->8---
It does not seem to be evaluated, however.
Is there a way to have arbitrary code stored in the file being exported
being evaluated before an export?
Thanks,
Alan
- [O] running some elisp code when exporting a given file,
Alan Schmitt <=