$tag
";
}
}
sub readTagFile
{
my($tagfile) = @_;
my( $tag, $file, $name );
open(TAGS,"$tagfile") || die "can't read tags\n";
while( EOF my $inexample = 0; while() { chop; if ( /^\s*[-=]+\s*$/ ) { print OUT "
";
next;
}
# examples
elsif( /^>$/ || /\s>$/ ) {
$inexample = 1;
chop;
}
elsif ( $inexample && /^([<\S])/ ) {
$inexample = 0;
$_ = $' if $1 eq "<";
}
s/\s+$//g;
# Various vim highlights. note that < and > have already been escaped
# so that HTML doesn't get screwed up.
my @out = ();
# print "Text: $_\n";
LOOP:
foreach my $token ( split /((?:\|[^\|]+\|)|(?:\*[^\*]+\*))/ ) {
if ( $token =~ /^\|([^\|]+)\|/ ) {
# link
push( @out, "|".maplink( $1 )."|" );
next LOOP;
}
elsif ( $token =~ /^\*([^\*]+)\*/ ) {
# target
push( @out,
"\*".esctext($1)."<\/a>\*<\/b>");
next LOOP;
}
$_ = esctext($token);
s/CTRL-(\w+)/CTRL-$1<\/code>/g;
# parameter <...>
s/<(.*?)>/<$1><\/code>/g;
# parameter {...}
s/\{([^}]*)\}/{$1}<\/code>/g;
# parameter [...]
s/\[(range|line|count|offset|cmd|[-+]?num)\]/\[$1\]<\/code>/g;
# note
s/(Note:?)/$1<\/code>/gi;
# local heading
s/^(.*)\~$/$1<\/code>/g;
push( @out, $_ );
}
$_ = join( "", @out );
if( $inexample == 2 ) {
print OUT "$_
\n";
} else {
print OUT $_,"\n";
}
$inexample = 2 if $inexample == 1;
}
print OUT<
Generated by vim2html on $day.$month.$year
EOF
}
sub usage
{
die<
EOF
}
sub writeCSS
{
open( CSS, ">vim-stylesheet.css" ) || die "Couldn't write stylesheet: $!\n";
print CSS<