summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7be2b6e)
raw | patch | inline | side by side (parent: 7be2b6e)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 10 Dec 2007 09:15:57 +0000 (01:15 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 10 Dec 2007 09:36:13 +0000 (01:36 -0800) |
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/Makefile | patch | blob | history | |
Documentation/cat-texi.perl | [new file with mode: 0755] | patch | blob |
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 9f0f9d70f6decd721141b48f9be2f0a8da429bcb..37ec355ba41e9f0cc6474ca0f04ec7e8921dfd59 100644 (file)
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt
MAN7_TXT=git.txt
-DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
+MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
+MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT))
+MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT))
+
+DOC_HTML=$(MAN_HTML)
ARTICLES = tutorial
ARTICLES += tutorial-2
man5: $(DOC_MAN5)
man7: $(DOC_MAN7)
-info: git.info
+info: git.info gitman.info
install: man
$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
install-info: info
$(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
- $(INSTALL) -m 644 git.info $(DESTDIR)$(infodir)
+ $(INSTALL) -m 644 git.info gitman.info $(DESTDIR)$(infodir)
if test -r $(DESTDIR)$(infodir)/dir; then \
$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
+ $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) gitman.info ;\
else \
echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
fi
user-manual.html: user-manual.xml
xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
-git.info: user-manual.xml
- $(RM) $@ $*.texi $*.texi+
- $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+
- $(PERL_PATH) fix-texi.perl <$*.texi+ >$*.texi
+git.info: git.texi
+ $(MAKEINFO) --no-split $*.texi
+
+git.texi: user-manual.xml
+ $(RM) $@+ $@
+ $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | $(PERL_PATH) fix-texi.perl >$@+
+ mv $@+ $@
+
+gitman.texi: $(MAN_XML) cat-texi.perl
+ $(RM) $@+ $@
+ ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --to-stdout $(xml);)) | \
+ $(PERL_PATH) cat-texi.perl $@ >$@+
+ mv $@+ $@
+
+gitman.info: gitman.texi
$(MAKEINFO) --no-split $*.texi
- $(RM) $*.texi $*.texi+
+
+$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
+ $(RM) $@+ $@
+ $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+
+ mv $@+ $@
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
$(RM) $@+ $@
diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+my @menu = ();
+my $output = $ARGV[0];
+
+open TMP, '>', "$output.tmp";
+
+while (<STDIN>) {
+ next if (/^\\input texinfo/../\@node Top/);
+ next if (/^\@bye/ || /^\.ft/);
+ if (s/^\@top (.*)/\@node $1,,,Top/) {
+ push @menu, $1;
+ }
+ s/\(\@pxref{\[URLS\]}\)//;
+ print TMP;
+}
+close TMP;
+
+printf '\input texinfo
+@setfilename gitman.info
+@documentencoding us-ascii
+@node Top,,%s
+@top Git Manual Pages
+@documentlanguage en
+@menu
+', $menu[0];
+
+for (@menu) {
+ print "* ${_}::\n";
+}
+print "\@end menu\n";
+open TMP, '<', "$output.tmp";
+while (<TMP>) {
+ print;
+}
+close TMP;
+print "\@bye\n";
+unlink "$output.tmp";