[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4ef1768 10/63: Add timestamp of source revision to HTML do
From: |
Noam Postavsky |
Subject: |
[elpa] master 4ef1768 10/63: Add timestamp of source revision to HTML doc |
Date: |
Mon, 17 Jul 2017 22:54:11 -0400 (EDT) |
branch: master
commit 4ef1768e8174b169ce4f329998b901931148f693
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Add timestamp of source revision to HTML doc
* doc/yas-doc-helper.el: Put revision's commit date into :html-postamble
project property. Use SOURCE_DATE_EPOCH instead of git data, if it's
defined.
---
doc/yas-doc-helper.el | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/doc/yas-doc-helper.el b/doc/yas-doc-helper.el
index ffce751..623ea9f 100644
--- a/doc/yas-doc-helper.el
+++ b/doc/yas-doc-helper.el
@@ -120,11 +120,20 @@
(let* ((dir (if load-file-name (file-name-directory load-file-name)
default-directory))
- (rev (with-temp-file (expand-file-name "html-revision" dir)
- (or (when (eq (call-process "git" nil t nil
- "rev-parse" "--verify" "HEAD") 0)
- (buffer-string))
- (princ yas--version (current-buffer)))))
+ (src-epoch (getenv "SOURCE_DATE_EPOCH"))
+ ;; Presence of SOURCE_DATE_EPOCH indicates a reproducible
+ ;; build, don't depend on git.
+ (rev (unless src-epoch
+ (ignore-errors
+ (car (process-lines "git" "rev-parse" "--verify" "HEAD")))))
+ (date (format-time-string
+ "(%Y-%m-%d %H:%M:%S)"
+ (seconds-to-time
+ (string-to-number
+ (or (if rev (car (process-lines "git" "show" "--format=%ct"
rev))
+ src-epoch)
+ "0")))
+ t))
(proj-plist
`(,@(when (fboundp 'org-html-publish-to-html)
'(:publishing-function org-html-publish-to-html))
@@ -134,10 +143,13 @@
(insert-file-contents (expand-file-name "nav-menu.html.inc" dir))
(buffer-string))
:html-postamble
- ,(concat "<hr><p class='creator'>Generated by %c on %d from "
- rev "</p>\n"
+ ,(concat "<hr><p class='creator'>Generated by %c from "
+ (or rev yas--version) " " date "</p>\n"
"<p class='xhtml-validation'>%v</p>\n")))
(project (assoc "yasnippet" org-publish-project-alist)))
+ (when rev ;; Rakefile :doc:upload uses "html-revision".
+ (with-temp-file (expand-file-name "html-revision" dir)
+ (princ rev (current-buffer))))
(if project
(setcdr project proj-plist)
(push `("yasnippet" . ,proj-plist)
- [elpa] master updated (2cdd182 -> 3fd07de), Noam Postavsky, 2017/07/17
- [elpa] master 4fa52e6 01/63: Improve final message produced by yas-reload-all, Noam Postavsky, 2017/07/17
- [elpa] master 8412d71 03/63: Reword #744 yet again, Noam Postavsky, 2017/07/17
- [elpa] master 4ef1768 10/63: Add timestamp of source revision to HTML doc,
Noam Postavsky <=
- [elpa] master 7b013db 06/63: Keep yas--snippets-at-point for compatibility, Noam Postavsky, 2017/07/17
- [elpa] master 5534cab 07/63: Respect yas-indent-line for mirror updates, Noam Postavsky, 2017/07/17
- [elpa] master c485d13 04/63: Remove last use of flet, Noam Postavsky, 2017/07/17
- [elpa] master 80a1098 02/63: Rework yas-reload-all message introduced by #744, Noam Postavsky, 2017/07/17
- [elpa] master 28d5496 11/63: Use git describe for doc HTML output, Noam Postavsky, 2017/07/17
- [elpa] master cce2e0d 09/63: Make the documentation build reproducible, Noam Postavsky, 2017/07/17
- [elpa] master 2ca6321 05/63: Promote yas--snippets-at-point to a public API, Noam Postavsky, 2017/07/17
- [elpa] master 9abf842 19/63: Enable snippet-mode automatically, Noam Postavsky, 2017/07/17
- [elpa] master 48cd716 14/63: Use more compact format for snippet menus, Noam Postavsky, 2017/07/17
- [elpa] master b62cf52 23/63: Remove lambda list building hack, Noam Postavsky, 2017/07/17