Function: org-html--build-pre/postamble
org-html--build-pre/postamble is a byte-compiled function defined in
ox-html.el.gz.
Signature
(org-html--build-pre/postamble TYPE INFO)
Documentation
Return document preamble or postamble as a string, or nil.
TYPE is either preamble or postamble, INFO is a plist used as a
communication channel.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ox-html.el.gz
(defun org-html--build-pre/postamble (type info)
"Return document preamble or postamble as a string, or nil.
TYPE is either `preamble' or `postamble', INFO is a plist used as a
communication channel."
(let ((section (plist-get info (intern (format ":html-%s" type))))
(spec (org-html-format-spec info)))
(when section
(let ((section-contents
(if (functionp section) (funcall section info)
(cond
((stringp section) (format-spec section spec))
((and (eq section 'auto) (eq type 'postamble))
(let ((date (cdr (assq ?d spec)))
(author (cdr (assq ?a spec)))
(email (cdr (assq ?e spec)))
(creator (cdr (assq ?c spec)))
(validation-link (cdr (assq ?v spec))))
(concat
(and (plist-get info :with-date)
(org-string-nw-p date)
(format "<p class=\"date\">%s: %s</p>\n"
(org-html--translate "Date" info)
date))
(and (plist-get info :with-author)
(org-string-nw-p author)
(format "<p class=\"author\">%s: %s</p>\n"
(org-html--translate "Author" info)
author))
(and (plist-get info :with-email)
(org-string-nw-p email)
(format "<p class=\"email\">%s: %s</p>\n"
(org-html--translate "Email" info)
email))
(and (plist-get info :time-stamp-file)
(format
"<p class=\"date\">%s: %s</p>\n"
(org-html--translate "Created" info)
(format-time-string
(plist-get info :html-metadata-timestamp-format))))
(and (plist-get info :with-creator)
(org-string-nw-p creator)
(format "<p class=\"creator\">%s</p>\n" creator))
(and (org-string-nw-p validation-link)
(format "<p class=\"validation\">%s</p>\n"
validation-link)))))
(t
(let ((formats (plist-get info (if (eq type 'preamble)
:html-preamble-format
:html-postamble-format)))
(language (plist-get info :language)))
(format-spec
(cadr (or (assoc-string language formats t)
(assoc-string "en" formats t)))
spec)))))))
(let ((div (assq type (plist-get info :html-divs))))
(when (org-string-nw-p section-contents)
(concat
(format "<%s id=\"%s\" class=\"%s\">\n"
(nth 1 div)
(nth 2 div)
org-html--pre/postamble-class)
(org-element-normalize-string section-contents)
(format "</%s>\n" (nth 1 div)))))))))