All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Documentation: Allow @@GIT_VERSION@@ in asciidoc.conf
@ 2007-03-23 18:54 Frank Lichtenheld
  2007-03-23 18:54 ` [PATCH 2/2] Documentation: Add version information to man pages Frank Lichtenheld
  2007-03-23 21:53 ` [PATCH 1/2] Documentation: Allow @@GIT_VERSION@@ in asciidoc.conf Junio C Hamano
  0 siblings, 2 replies; 11+ messages in thread
From: Frank Lichtenheld @ 2007-03-23 18:54 UTC (permalink / raw)
  To: git; +Cc: Frank Lichtenheld

Rename asciidoc.conf to asciidoc.conf.in and create
the former on build time after piping it through sed.

This is useful to allow us to include the git version
in the documentation.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
 Documentation/Makefile         |   11 ++++++++---
 Documentation/asciidoc.conf    |   39 ---------------------------------------
 Documentation/asciidoc.conf.in |   39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 42 deletions(-)
 delete mode 100644 Documentation/asciidoc.conf
 create mode 100644 Documentation/asciidoc.conf.in

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 7c1c9e1..6197929 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -38,6 +38,7 @@ DOC_REF = origin/man
 
 -include ../config.mak.autogen
 -include ../config.mak
+-include ../GIT-VERSION-FILE
 
 #
 # Please note that there is a minor bug in asciidoc.
@@ -90,16 +91,20 @@ $(cmds_txt): cmd-list.perl $(MAN1_TXT)
 git.7 git.html: git.txt core-intro.txt
 
 clean:
-	rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep
+	rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep asciidoc.conf
 	rm -f $(cmds_txt)
 
-%.html : %.txt
+asciidoc.conf: asciidoc.conf.in
+	sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' $< >$@+
+	mv $@+ $@
+
+%.html : %.txt asciidoc.conf
 	$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<
 
 %.1 %.7 : %.xml
 	xmlto -m callouts.xsl man $<
 
-%.xml : %.txt
+%.xml : %.txt asciidoc.conf
 	$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $<
 
 user-manual.xml: user-manual.txt user-manual.conf
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
deleted file mode 100644
index 44b1ce4..0000000
--- a/Documentation/asciidoc.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-## gitlink: macro
-#
-# Usage: gitlink:command[manpage-section]
-#
-# Note, {0} is the manpage section, while {target} is the command.
-#
-# Show GIT link as: <command>(<section>); if section is defined, else just show
-# the command.
-
-[attributes]
-caret=^
-startsb=&#91;
-endsb=&#93;
-tilde=&#126;
-
-ifdef::backend-docbook[]
-[gitlink-inlinemacro]
-{0%{target}}
-{0#<citerefentry>}
-{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
-{0#</citerefentry>}
-endif::backend-docbook[]
-
-ifdef::backend-docbook[]
-# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
-[listingblock]
-<example><title>{title}</title>
-<literallayout>
-|
-</literallayout>
-{title#}</example>
-endif::backend-docbook[]
-
-ifdef::backend-xhtml11[]
-[gitlink-inlinemacro]
-<a href="{target}.html">{target}{0?({0})}</a>
-endif::backend-xhtml11[]
-
-
diff --git a/Documentation/asciidoc.conf.in b/Documentation/asciidoc.conf.in
new file mode 100644
index 0000000..44b1ce4
--- /dev/null
+++ b/Documentation/asciidoc.conf.in
@@ -0,0 +1,39 @@
+## gitlink: macro
+#
+# Usage: gitlink:command[manpage-section]
+#
+# Note, {0} is the manpage section, while {target} is the command.
+#
+# Show GIT link as: <command>(<section>); if section is defined, else just show
+# the command.
+
+[attributes]
+caret=^
+startsb=&#91;
+endsb=&#93;
+tilde=&#126;
+
+ifdef::backend-docbook[]
+[gitlink-inlinemacro]
+{0%{target}}
+{0#<citerefentry>}
+{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
+{0#</citerefentry>}
+endif::backend-docbook[]
+
+ifdef::backend-docbook[]
+# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
+[listingblock]
+<example><title>{title}</title>
+<literallayout>
+|
+</literallayout>
+{title#}</example>
+endif::backend-docbook[]
+
+ifdef::backend-xhtml11[]
+[gitlink-inlinemacro]
+<a href="{target}.html">{target}{0?({0})}</a>
+endif::backend-xhtml11[]
+
+
-- 
1.5.0.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-03-27  6:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-23 18:54 [PATCH 1/2] Documentation: Allow @@GIT_VERSION@@ in asciidoc.conf Frank Lichtenheld
2007-03-23 18:54 ` [PATCH 2/2] Documentation: Add version information to man pages Frank Lichtenheld
2007-03-23 21:53 ` [PATCH 1/2] Documentation: Allow @@GIT_VERSION@@ in asciidoc.conf Junio C Hamano
2007-03-24 12:04   ` Frank Lichtenheld
2007-03-24 14:26     ` Brian Gernhardt
2007-03-24 21:33     ` Junio C Hamano
2007-03-25 11:56       ` [PATCH 1/2] Documentation: Replace @@GIT_VERSION@@ in documentation Frank Lichtenheld
2007-03-25 11:56         ` [PATCH 2/2] Documentation: Add version information to man pages Frank Lichtenheld
2007-03-27  6:55           ` Junio C Hamano
2007-03-26  5:33         ` [PATCH 1/2] Documentation: Replace @@GIT_VERSION@@ in documentation Junio C Hamano
2007-03-26  5:45           ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.