annotate runtime/doc/vim2html.pl @ 34257:8a91d18f1789 v9.1.0069

patch 9.1.0069: ScreenLines may not be correctly initialized, causing hang Commit: https://github.com/vim/vim/commit/fd472655a93fd539c731c8daf3adc4e65ddce341 Author: Olaf Seibert <rhialto@falu.nl> Date: Thu Feb 1 21:11:16 2024 +0100 patch 9.1.0069: ScreenLines may not be correctly initialized, causing hang Problem: ScreenLines may not be correctly initialized, causing hang (Olaf Seibert, after 9.0.0220) Solution: always initialize ScreneLines when allocating a screen (Olaf Seibert) ScreenLines and related structures could be left uninitialized causing a screen update to run into an infinite loop when using latin1 encoding. Partly caused because by patch 9.0.0220, which makes mb_ptr2len return zero for NUL related: #12671 closes: #13946 Signed-off-by: Olaf Seibert <rhialto@falu.nl> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 01 Feb 2024 21:30:02 +0100
parents e09acb1daea7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 #!/usr/bin/env perl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 # converts vim documentation to simple html
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 # Sirtaj Singh Kang (taj@kde.org)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 # Sun Feb 24 14:49:17 CET 2002
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 use strict;
33712
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
9 use warnings;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 use vars qw/%url $date/;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 %url = ();
33712
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
13 # 30.11.23, Restorer:
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
14 # This command does not work in OS Windows.
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
15 # The "date" command in Windows is different from its counterpart in UNIX-like systems.
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
16 # The closest analog is the "date /t" command, but how it would work in UNIX,
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
17 # I don't know. I've corrected it as best I can. I don't know Perl.
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
18 #$date = `date`;
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
19 #chop $date;
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
20 my ($year) = 1900 + (localtime())[5];
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
21 my ($month) = 1 + (localtime())[4];
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
22 my ($day) = (localtime())[3];
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
23 #$date = localtime(); # outputs like this Fri Nov 3 00:56:59 2023
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 sub maplink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 my $tag = shift;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 if( exists $url{ $tag } ){
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 return $url{ $tag };
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 #warn "Unknown hyperlink target: $tag\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 $tag =~ s/\.txt//;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 $tag =~ s/</&lt;/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 $tag =~ s/>/&gt;/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 return "<code class=\"badlink\">$tag</code>";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 sub readTagFile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 my($tagfile) = @_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 my( $tag, $file, $name );
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 open(TAGS,"$tagfile") || die "can't read tags\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 while( <TAGS> ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 next unless /^(\S+)\s+(\S+)\s+/;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 $tag = $1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 my $label = $tag;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 ($file= $2) =~ s/.txt$/.html/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 $label =~ s/\.txt//;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 $url{ $tag } = "<a href=\"$file#".escurl($tag)."\">".esctext($label)."</a>";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 close( TAGS );
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 sub esctext
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 my $text = shift;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 $text =~ s/&/&amp;/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 $text =~ s/</&lt;/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 $text =~ s/>/&gt;/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 return $text;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 sub escurl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 my $url = shift;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 $url =~ s/"/%22/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 $url =~ s/~/%7E/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 $url =~ s/</%3C/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 $url =~ s/>/%3E/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 $url =~ s/=/%20/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 $url =~ s/#/%23/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 $url =~ s/\//%2F/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 return $url;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 sub vim2html
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 my( $infile ) = @_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 my( $outfile );
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 open(IN, "$infile" ) || die "Couldn't read from $infile: $!.\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 ($outfile = $infile) =~ s:.*/::g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 $outfile =~ s/\.txt$//g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 open( OUT, ">$outfile.html" )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 || die "Couldn't write to $outfile.html: $!.\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 my $head = uc( $outfile );
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 print OUT<<EOF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 <html>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 <head>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 <title>VIM: $outfile</title>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 <link rel="stylesheet" href="vim-stylesheet.css" type="text/css">
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 </head>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 <body>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 <h2>$head</h2>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 <pre>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 EOF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 my $inexample = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 while( <IN> ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 chop;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 if ( /^\s*[-=]+\s*$/ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 print OUT "</pre><hr><pre>";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 # examples
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 elsif( /^>$/ || /\s>$/ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 $inexample = 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 chop;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 elsif ( $inexample && /^([<\S])/ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 $inexample = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 $_ = $' if $1 eq "<";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 s/\s+$//g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 # Various vim highlights. note that < and > have already been escaped
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 # so that HTML doesn't get screwed up.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 my @out = ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 # print "Text: $_\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 LOOP:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 foreach my $token ( split /((?:\|[^\|]+\|)|(?:\*[^\*]+\*))/ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 if ( $token =~ /^\|([^\|]+)\|/ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 # link
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 push( @out, "|".maplink( $1 )."|" );
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 next LOOP;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 elsif ( $token =~ /^\*([^\*]+)\*/ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 # target
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 push( @out,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 "<b class=\"vimtag\">\*<a name=\"".escurl($1)."\">".esctext($1)."<\/a>\*<\/b>");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 next LOOP;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 $_ = esctext($token);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 s/CTRL-(\w+)/<code class="keystroke">CTRL-$1<\/code>/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 # parameter <...>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 s/&lt;(.*?)&gt;/<code class="special">&lt;$1&gt;<\/code>/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 # parameter {...}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 s/\{([^}]*)\}/<code class="special">{$1}<\/code>/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 # parameter [...]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 s/\[(range|line|count|offset|cmd|[-+]?num)\]/<code class="special">\[$1\]<\/code>/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 # note
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 s/(Note:?)/<code class="note">$1<\/code>/gi;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 # local heading
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 s/^(.*)\~$/<code class="section">$1<\/code>/g;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 push( @out, $_ );
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 $_ = join( "", @out );
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 if( $inexample == 2 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 print OUT "<code class=\"example\">$_</code>\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 print OUT $_,"\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 $inexample = 2 if $inexample == 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 print OUT<<EOF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 </pre>
33712
e09acb1daea7 runtime(doc): Add Makefile for the Vim documentation on Windows (#13467)
Christian Brabandt <cb@256bit.org>
parents: 2642
diff changeset
177 <p><i>Generated by vim2html on $day.$month.$year</i></p>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 </body>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 </html>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 EOF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 sub usage
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 die<<EOF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 vim2html.pl: converts vim documentation to HTML.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 usage:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 vim2html.pl <tag file> <text files>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 EOF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 sub writeCSS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 open( CSS, ">vim-stylesheet.css" ) || die "Couldn't write stylesheet: $!\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 print CSS<<EOF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 body { background-color: white; color: black;}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 :link { color: rgb(0,137,139); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 :visited { color: rgb(0,100,100);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 background-color: white; /* should be inherit */ }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 :active { color: rgb(0,200,200);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 background-color: white; /* should be inherit */ }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 B.vimtag { color : rgb(250,0,250); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 h1, h2 { color: rgb(82,80,82); text-align: center; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 h3, h4, h5, h6 { color: rgb(82,80,82); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 .headline { color: rgb(0,137,139); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 .header { color: rgb(164, 32, 246); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 .section { color: rgb(164, 32, 246); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 .keystroke { color: rgb(106, 89, 205); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 .vim { }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 .example { color: rgb(0, 0, 255); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 .option { }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 .notvi { }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 .special { color: rgb(106, 89, 205); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 .note { color: blue; background-color: yellow; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 .sub {}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 .badlink { color: rgb(0,37,39); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 EOF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 # main
2642
840c3cadb842 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
227 usage() if $#ARGV < 1;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 print "Processing tags...\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 readTagFile( $ARGV[ 0 ] );
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 foreach my $file ( 1..$#ARGV ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 print "Processing ".$ARGV[ $file ]."...\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 vim2html( $ARGV[ $file ] );
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 print "Writing stylesheet...\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 writeCSS();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 print "done.\n"