Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
805 B

#!/usr/bin/perl -w
use strict;
use warnings;
my @menu = ();
my $output = $ARGV[0];
open my $tmp, '>', "$output.tmp";
while (<STDIN>) {
next if (/^\\input texinfo/../\@node Top/);
next if (/^\@bye/ || /^\.ft/);
if (s/^\@top (.*)/\@node $1,,,Top/) {
push @menu, $1;
print $tmp $_;
close $tmp;
print '\input texinfo
@documentencoding UTF-8
@dircategory Development
* Git Man Pages: (gitman). Manual pages for Git revision control system
@end direntry
@node Top,,, (dir)
@top Git Manual Pages
@documentlanguage en
for (@menu) {
print "* ${_}::\n";
print "\@end menu\n";
open $tmp, '<', "$output.tmp";
while (<$tmp>) {
close $tmp;
print "\@bye\n";
unlink "$output.tmp";