-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation: add gitman.info target
Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
Junio C Hamano
committed
Dec 10, 2007
1 parent
7be2b6e
commit 5cefc33
Showing
2 changed files
with
66 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; |