ox-html: Allow to add last modification time in preamble/postamble

* lisp/ox-html.el (org-html-postamble-format,
  org-html-preamble-format): Allow last modification time of source in
  template.
(org-html-format-spec): Produce last modification time when the source
is a file.
This commit is contained in:
Nicolas Goaziou 2013-04-07 14:59:27 +02:00
parent c1d716f703
commit bd61cb2bf0

View file

@ -1037,6 +1037,7 @@ postamble itself. This format string can contain these elements:
%c will be replaced by `org-html-creator-string'. %c will be replaced by `org-html-creator-string'.
%v will be replaced by `org-html-validation-link'. %v will be replaced by `org-html-validation-link'.
%T will be replaced by the export time. %T will be replaced by the export time.
%C will be replaced by the last modification time.
If you need to use a \"%\" character, you need to escape it If you need to use a \"%\" character, you need to escape it
like that: \"%%\"." like that: \"%%\"."
@ -1097,6 +1098,7 @@ preamble itself. This format string can contain these elements:
%c will be replaced by `org-html-creator-string'. %c will be replaced by `org-html-creator-string'.
%v will be replaced by `org-html-validation-link'. %v will be replaced by `org-html-validation-link'.
%T will be replaced by the export time. %T will be replaced by the export time.
%C will be replaced by the last modification time.
If you need to use a \"%\" character, you need to escape it If you need to use a \"%\" character, you need to escape it
like that: \"%%\". like that: \"%%\".
@ -1506,6 +1508,10 @@ used in the preamble or postamble."
(split-string (plist-get info :email) ",+ *") (split-string (plist-get info :email) ",+ *")
", ")) ", "))
(?c . ,(plist-get info :creator)) (?c . ,(plist-get info :creator))
(?C . ,(let ((file (plist-get info :input-file)))
(format-time-string org-html--timestamp-format
(if file (nth 5 (file-attributes file))
(current-time)))))
(?v . ,(or org-html-validation-link "")))) (?v . ,(or org-html-validation-link ""))))
(defun org-html--build-pre/postamble (type info) (defun org-html--build-pre/postamble (type info)