summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-07-19 18:33:53 +0200
committerBastien Guerry <bzg@altern.org>2011-07-19 18:33:53 +0200
commit3482284bbd693cdf6bdd884a923ac0d5cd3636db (patch)
tree577b80a3739db12e7285ecf2b0c4038ae1257a1f
parentf3e563476b452f297bf1b0e466b0b75fb9bb7a23 (diff)
downloadorg-mode-3482284bbd693cdf6bdd884a923ac0d5cd3636db.tar.gz
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.
-rw-r--r--doc/org.texi10
-rw-r--r--lisp/org-html.el4
2 files changed, 9 insertions, 5 deletions
diff --git a/doc/org.texi b/doc/org.texi
index fb1950a..a0a78b7 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 82d369d..7bb8b61 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 "</div>"))
((functionp html-post)
- (funcall html-post opt-plist))
+ (funcall html-post))
((eq html-post 'auto)
;; fall back on default postamble
(insert "<div id=\"postamble\">\n")