]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/cat-texi.perl
t4034: abstract away SHA-1-specific constants
[thirdparty/git.git] / Documentation / cat-texi.perl
CommitLineData
5cefc33b
JH
1#!/usr/bin/perl -w
2
b56867c9 3use strict;
4use warnings;
5
5cefc33b
JH
6my @menu = ();
7my $output = $ARGV[0];
8
b56867c9 9open my $tmp, '>', "$output.tmp";
5cefc33b
JH
10
11while (<STDIN>) {
12 next if (/^\\input texinfo/../\@node Top/);
13 next if (/^\@bye/ || /^\.ft/);
14 if (s/^\@top (.*)/\@node $1,,,Top/) {
15 push @menu, $1;
16 }
f7bf8fea 17 s/\(\@pxref\{\[(URLS|REMOTES)\]}\)//;
cbfd124c 18 s/\@anchor\{[^{}]*\}//g;
b56867c9 19 print $tmp $_;
5cefc33b 20}
b56867c9 21close $tmp;
5cefc33b 22
a7e1b15c 23print '\input texinfo
5cefc33b 24@setfilename gitman.info
9c6c304d
TL
25@documentencoding UTF-8
26@dircategory Development
27@direntry
28* Git Man Pages: (gitman). Manual pages for Git revision control system
29@end direntry
30@node Top,,, (dir)
5cefc33b
JH
31@top Git Manual Pages
32@documentlanguage en
33@menu
a7e1b15c 34';
5cefc33b
JH
35
36for (@menu) {
37 print "* ${_}::\n";
38}
39print "\@end menu\n";
b56867c9 40open $tmp, '<', "$output.tmp";
41while (<$tmp>) {
5cefc33b
JH
42 print;
43}
b56867c9 44close $tmp;
5cefc33b
JH
45print "\@bye\n";
46unlink "$output.tmp";