summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 738cb15)
raw | patch | inline | side by side (parent: 738cb15)
author | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 31 May 2007 08:31:34 +0000 (10:31 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 31 May 2007 08:31:34 +0000 (10:31 +0200) |
Inspired and copied from git 7ef195ba3efe0ffa815e12afc4cb1e39a21ddfb4:
Override the [header] macro of asciidoc's docbook
backend to add version information to the generated
man pages.
by Frank Lichtenheld <frank@lichtenheld.de>. Slightly improved to
use asciidoc {version} macro to avoid having to invoke sed.
Override the [header] macro of asciidoc's docbook
backend to add version information to the generated
man pages.
by Frank Lichtenheld <frank@lichtenheld.de>. Slightly improved to
use asciidoc {version} macro to avoid having to invoke sed.
Makefile | patch | blob | history | |
asciidoc.conf | patch | blob | history |
diff --git a/Makefile b/Makefile
index f8e601d5322c9afac77e55f3787257b62caa22f0..5e96234d627a5edaaa02b61af80e6532afb7e24a 100644 (file)
--- a/Makefile
+++ b/Makefile
manual.toc manual.pdf
ifneq (,$(wildcard .git))
-VERSION = $(shell git-describe)
-WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null)
-CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"'
+GITDESC = $(subst tig-,,$(shell git describe))
+WTDIRTY = $(if $(shell git-diff-index HEAD 2>/dev/null),-dirty)
+VERSION = $(GITDESC)$(WTDIRTY)
+CFLAGS += '-DVERSION="tig-$(VERSION)"'
endif
all: $(PROGS)
asciidoc -b xhtml11 -d manpage $<
%.1.xml : %.1.txt
- asciidoc -b docbook -d manpage $<
+ asciidoc -b docbook -d manpage -aversion=$(VERSION) $<
%.1 : %.1.xml
xmlto -m manpage.xsl man $<
asciidoc -b xhtml11 -d manpage $<
%.5.xml : %.5.txt
- asciidoc -b docbook -d manpage $<
+ asciidoc -b docbook -d manpage -aversion=$(VERSION) $<
%.5 : %.5.xml
xmlto -m manpage.xsl man $<
diff --git a/asciidoc.conf b/asciidoc.conf
index 8343a86cbb75f43f3df1c54f17a22191f6ca7a0b..8ad167ab4ee2c0218aa2f87f7badf34d70f80f2f 100644 (file)
--- a/asciidoc.conf
+++ b/asciidoc.conf
<a href="{target}{0?.{0}}.html">{target}{0?({0})}</a>
endif::backend-xhtml11[]
+ifdef::doctype-manpage[]
+ifdef::backend-docbook[]
+[header]
+template::[header-declarations]
+<refentry>
+<refmeta>
+<refentrytitle>{mantitle}</refentrytitle>
+<manvolnum>{manvolnum}</manvolnum>
+<refmiscinfo class="source">Tig</refmiscinfo>
+<refmiscinfo class="version">{version}</refmiscinfo>
+<refmiscinfo class="manual">Tig Manual</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>{manname}</refname>
+ <refpurpose>{manpurpose}</refpurpose>
+</refnamediv>
+endif::backend-docbook[]
+endif::doctype-manpage[]
+
ifdef::readme[]
# No header or footers for README.html
[header]