3 # converts vim documentation to simple html
4 # Sirtaj Singh Kang (taj@kde.org)
6 # Wed Oct 8 01:15:48 EST 1997
16 local( $tag, $file, $name );
18 open(TAGS
,"$tagfile") || die "can't read tags\n";
27 ($file= $2) =~ s/.txt$/.html/g;
29 $url{ $tag } = "<A HREF=\"$file#$tag\">$tag</A>";
31 #print "($tag, $file, $tag)\n";
41 open(IN
, "$infile" ) || die "Couldn't read from $infile.\n";
43 ($outfile = $infile) =~ s
%.*/%%g;
44 $outfile =~ s/\.txt$//g;
46 open( OUT
, ">$outfile.html" )
47 || die "Couldn't write to $outfile.html.\n";
51 <HEAD><TITLE>$outfile</TITLE></HEAD>
52 <BODY BGCOLOR="#ffffff">
53 <H1>Vim Documentation: $outfile</H1>
62 s/\*([^*]*)\*/\*<A NAME="$1"><\/A
><B
>$1<\
/B>\*/g;
63 s/\|([^|]*)\|/\|$url{$1}\|/g;
69 <p><i>Generated by vim2html on $date</i></p>
79 vim2html.pl: converts vim documentation to HTML.
82 vim2html.pl <tag file> <text files>
92 print "Processing tags...\n";
93 readTagFile
( $ARGV[ 0 ] );
95 foreach $file ( 1..$#ARGV ) {
96 print "Processing ".$ARGV[ $file ]."...\n";
97 vim2html
( $ARGV[ $file ] );