From 3482284bbd693cdf6bdd884a923ac0d5cd3636db Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 19 Jul 2011 18:33:53 +0200 Subject: [PATCH] Make sure :html-pre/postamble can insert the output of a custom function. This function must have no argument and must output a string to be inserted in the HTML export. Thanks to Sander Boer for pointing at this. --- doc/org.texi | 10 +++++++--- lisp/org-html.el | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index fb1950a66..a0a78b777 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -9766,10 +9766,14 @@ The HTML exporter lets you define a preamble and a postamble. The default value for @code{org-export-html-preamble} is @code{t}, which means that the preamble is inserted depending on the relevant formatting -string in @code{org-export-html-preamble-format}. Setting -@code{org-export-html-preamble} to a string will override the default +string in @code{org-export-html-preamble-format}. + +Setting @code{org-export-html-preamble} to a string will override the default formatting string. Setting it to a function, will insert the output of the -function. Setting to @code{nil} will not insert any preamble. +function, which must be a string; such a function takes no argument but you +can check against the value of @code{opt-plist}, which contains the list of +publishing properties for the current file. Setting to @code{nil} will not +insert any preamble. The default value for @code{org-export-html-postamble} is @code{'auto}, which means that the HTML exporter will look for the value of diff --git a/lisp/org-html.el b/lisp/org-html.el index 82d369db2..7bb8b6167 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1335,7 +1335,7 @@ lang=\"%s\" xml:lang=\"%s\"> (format-spec html-pre `((?t . ,title) (?a . ,author) (?d . ,date) (?e . ,email))))) ((functionp html-pre) - (funcall html-pre opt-plist)) + (funcall html-pre)) (t (insert (format-spec @@ -1768,7 +1768,7 @@ lang=\"%s\" xml:lang=\"%s\"> (?v . ,html-validation-link)))) (insert "")) ((functionp html-post) - (funcall html-post opt-plist)) + (funcall html-post)) ((eq html-post 'auto) ;; fall back on default postamble (insert "
\n")