[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] running some elisp code when exporting a given file
From: |
Nicolas Goaziou |
Subject: |
Re: [O] running some elisp code when exporting a given file |
Date: |
Thu, 05 Sep 2013 12:13:05 +0200 |
Hello,
Alan Schmitt <address@hidden> writes:
> 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:
>
> #+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
>
> 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?
I think this has to do with ":exports none", which means that code will
not be evaluated during export. You may want to try setting the
attribute to some other value, and put the block in a :noexport: entry.
Regards,
--
Nicolas Goaziou