blob: 828ec62554fe927eb16a03f835448e6db0c303a1 [file] [log] [blame]
Junio C Hamano5cefc332007-12-10 01:15:57 -08001#!/usr/bin/perl -w
2
3my @menu = ();
4my $output = $ARGV[0];
5
6open TMP, '>', "$output.tmp";
7
8while (<STDIN>) {
9 next if (/^\\input texinfo/../\@node Top/);
10 next if (/^\@bye/ || /^\.ft/);
11 if (s/^\@top (.*)/\@node $1,,,Top/) {
12 push @menu, $1;
13 }
Junio C Hamano5ada3692008-06-12 14:21:05 -070014 s/\(\@pxref{\[(URLS|REMOTES)\]}\)//;
Junio C Hamano5cefc332007-12-10 01:15:57 -080015 print TMP;
16}
17close TMP;
18
19printf '\input texinfo
20@setfilename gitman.info
Teemu Likonen9c6c3042008-12-29 10:03:09 +020021@documentencoding UTF-8
22@dircategory Development
23@direntry
24* Git Man Pages: (gitman). Manual pages for Git revision control system
25@end direntry
26@node Top,,, (dir)
Junio C Hamano5cefc332007-12-10 01:15:57 -080027@top Git Manual Pages
28@documentlanguage en
29@menu
30', $menu[0];
31
32for (@menu) {
33 print "* ${_}::\n";
34}
35print "\@end menu\n";
36open TMP, '<', "$output.tmp";
37while (<TMP>) {
38 print;
39}
40close TMP;
41print "\@bye\n";
42unlink "$output.tmp";