org-html.el: fix docstrings and the pre/postamble inserting.

* org-html.el (org-export-html-preamble)
(org-export-html-postamble): Fix docstrings.
(org-export-as-html): Insert the string used by a custom
function for `org-export-html-pre/postamble'.

The documentation is now in sync with the behavior: a custom
function for `org-export-html-pre/postamble' takes no argument,
and its value is inserted as a string.  Before that, users had
to use (insert ...) constructs to insert content in the preamble
through a custom function.

Thanks to Bill Jackson for spotting these inconsistencies.
This commit is contained in:
Bastien Guerry 2011-12-13 00:10:00 +01:00
parent 4fb95b4eb2
commit 83d1c71bd7

View file

@ -370,8 +370,8 @@ When `t', insert a string as defined by one of the formatting
strings in `org-export-html-preamble-format'. When set to a
string, this string overrides `org-export-html-preamble-format'.
When set to a function, apply this function and insert the
returned string. The function takes the property list of export
options as its only argument.
returned string. The function takes no argument, but you can
use `opt-plist' to access the current export options.
Setting :html-preamble in publishing projects will take
precedence over this variable."
@ -403,8 +403,8 @@ string overrides `org-export-html-postamble-format'. When set to
'auto, discard `org-export-html-postamble-format' and honor
`org-export-author/email/creator-info' variables. When set to a
function, apply this function and insert the returned string.
The function takes the property list of export options as its
only argument.
The function takes no argument, but you can use `opt-plist' to
access the current export options.
Setting :html-postamble in publishing projects will take
precedence over this variable."
@ -1358,7 +1358,7 @@ PUB-DIR is set, use this as the publishing directory."
(?d . ,date) (?e . ,email)))))
((functionp html-pre)
(insert "<div id=\"" (nth 0 org-export-html-divs) "\">\n")
(funcall html-pre)
(if (stringp (funcall html-pre)) (insert (funcall html-pre)))
(insert "\n</div>\n"))
(t
(setq html-pre-real-contents
@ -1816,7 +1816,7 @@ PUB-DIR is set, use this as the publishing directory."
(?d . ,date) (?c . ,creator-info)
(?v . ,html-validation-link)))))
((functionp html-post)
(funcall html-post))
(if (stringp (funcall html-post)) (insert (funcall html-post))))
((eq html-post 'auto)
;; fall back on default postamble
(when (plist-get opt-plist :time-stamp-file)