emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* running some elisp code when exporting a given file
@ 2013-09-05  7:58 Alan Schmitt
  2013-09-05 10:07 ` Myles English
  2013-09-05 10:13 ` Nicolas Goaziou
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Schmitt @ 2013-09-05  7:58 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-06 17:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-05  7:58 running some elisp code when exporting a given file Alan Schmitt
2013-09-05 10:07 ` Myles English
2013-09-05 12:39   ` Alan Schmitt
2013-09-05 10:13 ` Nicolas Goaziou
2013-09-05 12:39   ` Alan Schmitt
2013-09-06 17:41     ` Eric Schulte

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).