diff options
author | Bastien Guerry <bzg@altern.org> | 2011-12-13 00:10:00 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-12-13 00:10:00 +0100 |
commit | 83d1c71bd72185ff32c4f61610f8f2109b09d057 (patch) | |
tree | 4c31f0388ecccabd37f0ccb292adf8573065e237 | |
parent | 4fb95b4eb2a048b3557879e54a5e899e9fafa3f9 (diff) | |
download | org-mode-83d1c71bd72185ff32c4f61610f8f2109b09d057.tar.gz |
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.
-rw-r--r-- | lisp/org-html.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/org-html.el b/lisp/org-html.el index 3724cfc..c6a19c8 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -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) |