From c1d716f703acd0dcf6fd6c9568fd788e3af4f985 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 7 Apr 2013 14:52:43 +0200 Subject: [PATCH 1/2] ox-html: Fix docstrings * lisp/ox-html.el (org-html-postamble-format, org-html-preamble-format): Fix docstrings. --- lisp/ox-html.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 9a2da626b..1d69f806a 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1025,7 +1025,7 @@ precedence over this variable." "Alist of languages and format strings for the HTML postamble. The first element of each list is the language code, as used for -the LANGUAGE keyword. See `org-export-default-language' +the LANGUAGE keyword. See `org-export-default-language'. The second element of each list is a format string to format the postamble itself. This format string can contain these elements: @@ -1034,10 +1034,9 @@ postamble itself. This format string can contain these elements: %a stands for the author's name. %e stands for the author's email. %d stands for the date. - %c will be replaced by creator information. See - `org-html-creator-string'. + %c will be replaced by `org-html-creator-string'. %v will be replaced by `org-html-validation-link'. - %T will be replaced by the creation time of the HTML file. + %T will be replaced by the export time. If you need to use a \"%\" character, you need to escape it like that: \"%%\"." @@ -1086,7 +1085,7 @@ precedence over this variable." "Alist of languages and format strings for the HTML preamble. The first element of each list is the language code, as used for -the #+LANGUAGE keyword. +the LANGUAGE keyword. See `org-export-default-language'. The second element of each list is a format string to format the preamble itself. This format string can contain these elements: @@ -1095,9 +1094,9 @@ preamble itself. This format string can contain these elements: %a stands for the author's name. %e stands for the author's email. %d stands for the date. - %c will be replaced by information about Org/Emacs versions. + %c will be replaced by `org-html-creator-string'. %v will be replaced by `org-html-validation-link'. - %T will be replace by the creation time of the file. + %T will be replaced by the export time. If you need to use a \"%\" character, you need to escape it like that: \"%%\". From bd61cb2bf0ec41bb5919fdc8c02b44682363e222 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 7 Apr 2013 14:59:27 +0200 Subject: [PATCH 2/2] 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. --- lisp/ox-html.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 1d69f806a..844a8d681 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1037,6 +1037,7 @@ postamble itself. This format string can contain these elements: %c will be replaced by `org-html-creator-string'. %v will be replaced by `org-html-validation-link'. %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 like that: \"%%\"." @@ -1097,6 +1098,7 @@ preamble itself. This format string can contain these elements: %c will be replaced by `org-html-creator-string'. %v will be replaced by `org-html-validation-link'. %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 like that: \"%%\". @@ -1506,6 +1508,10 @@ used in the preamble or postamble." (split-string (plist-get info :email) ",+ *") ", ")) (?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 "")))) (defun org-html--build-pre/postamble (type info)