From 4121ef7b3e4f6389fb05597fc159d9929ba84471 Mon Sep 17 00:00:00 2001 From: Jakob Voss Date: Wed, 23 May 2012 12:40:46 +0200 Subject: [PATCH] include git revision hash and date --- Makefile | 13 ++++++++++--- paia.md | 7 ++++--- template.html => template.html5 | 0 3 files changed, 14 insertions(+), 6 deletions(-) rename template.html => template.html5 (100%) diff --git a/Makefile b/Makefile index c7e019f..2f94416 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,10 @@ -paia.html: paia.md template.html references.bib - pandoc -N --bibliography=references.bib --template=template --toc -5 -o paia.html paia.md - perl -p -i -e 's!(http://[^<]+)\.

!$$1.

!g' paia.html +REVHASH=$(shell git log -1 --format="%H" paia.md) +REVDATE=$(shell git log -1 --format="%ad" --date=short paia.md) + +paia.html: paia.md template.html5 references.bib + sed s/GIT_REVISION_DATE/${REVDATE}/ paia.md \ + | pandoc -N --bibliography=references.bib --template=template --toc -f markdown -t html5 -- \ + | perl -p -e 's!(http://[^<]+)\.

!$$1.

!g' \ + | sed 's!GIT_REVISION_HASH!${REVHASH}<\/a>!' > paia.html + + diff --git a/paia.md b/paia.md index db967ef..d72c718 100644 --- a/paia.md +++ b/paia.md @@ -1,7 +1,6 @@ % Patrons Account Information API (PAIA) % Jakob Voß -% 2012-05-22 - +% GIT_REVISION_DATE # Introduction @@ -20,7 +19,9 @@ based on use cases and taking into account existing related standards and products such as NISO Circulation Interchange Protocol (NCIP), \[X]SLNP, DLF-ILS recommendations, and ViFind ILS drivers. -Updates and sources can be found at . +Updates and sources can be found at . The current +version of this document was last modified at GIT_REVISION_DATE with revision +GIT_REVISION_HASH. ## Conformance requirements diff --git a/template.html b/template.html5 similarity index 100% rename from template.html rename to template.html5