annotate runtime/doc/makehtml.awk @ 29:ac33b7c03fac v7.0018

updated for version 7.0018
author vimboss
date Mon, 11 Oct 2004 10:16:09 +0000
parents 3fc0f57ecb91
children 07d199fe02ed
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 BEGIN {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 # some initialization variables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 asciiart="no";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 wasset="no";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 lineset=0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 sample="no";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 while ( getline ti <"tags.ref" > 0 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 nf=split(ti,tag," ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 tagkey[tag[1]]="yes";tagref[tag[1]]=tag[2];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 skip_word["and"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 skip_word["backspace"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 skip_word["beep"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 skip_word["bugs"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 skip_word["da"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 skip_word["end"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 skip_word["ftp"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 skip_word["go"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 skip_word["help"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 skip_word["home"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 skip_word["news"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 skip_word["index"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 skip_word["insert"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 skip_word["into"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 skip_word["put"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 skip_word["reference"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 skip_word["section"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 skip_word["space"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 skip_word["starting"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 skip_word["toggle"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 skip_word["various"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 skip_word["version"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 skip_word["is"]="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 # protect special chars
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 /[><&á]/ {gsub(/&/,"\\&amp;");gsub(/>/,"\\&gt;");gsub(/</,"\\&lt;");gsub("á","\\&aacute;");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 # end of sample lines by non-blank in first column
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 sample == "yes" && substr($0,1,4) == "&lt;" { sample = "no"; gsub(/^&lt;/, " "); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 sample == "yes" && substr($0,1,1) != " " && substr($0,1,1) != " " && length($0) > 0 { sample = "no" }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 # sample lines printed bold unless empty...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 sample == "yes" && $0 =="" { print ""; next; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 sample == "yes" && $0 !="" { print "<B>" $0 "</B>"; next; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 # start of sample lines in next line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 $0 == "&gt;" { sample = "yes"; print ""; next; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 substr($0,length($0)-4,5) == " &gt;" { sample = "yes"; gsub(/ &gt;$/, ""); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 # header lines printed bold, colored
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 substr($0,length($0),1) == "~" { print "<B><FONT COLOR=\"PURPLE\">" substr($0,1,length($0)-1) "</FONT></B>"; next; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 #ad hoc code
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 /^"\|\& / {gsub(/\|/,"\\&#124;"); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 / = b / {gsub(/ b /," \\&#98; "); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 # one letter tag
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 /[ ]\*.\*[ ]/ {gsub(/\*/,"ZWWZ"); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 # isolated "*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 /[ ]\*[ ]/ {gsub(/ \* /," \\&#42; ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 gsub(/ \* /," \\&#42; ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 gsub(/ \* /," \\&#42; ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 gsub(/ \* /," \\&#42; "); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 # tag start
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 /[ ]\*[^ ]/ {gsub(/ \*/," ZWWZ");gsub(/ \*/," ZWWZ");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 /^\*[^ ]/ {gsub(/^\*/,"ZWWZ");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 # tag end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 /[^ ]\*$/ {gsub(/\*$/,"ZWWZ");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 /[^ \/ ]\*[ ]/ {gsub(/\*/,"ZWWZ");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 # isolated "|"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 /[ ]\|[ ]/ {gsub(/ \| /," \\&#124; ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 gsub(/ \| /," \\&#124; ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 gsub(/ \| /," \\&#124; ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 gsub(/ \| /," \\&#124; "); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 /'\|'/ { gsub(/'\|'/,"'\\&#124;'"); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 /\^V\|/ {gsub(/\^V\|/,"^V\\&#124;");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 / \\\| / {gsub(/\|/,"\\&#124;");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 # one letter pipes and "||" false pipe (digraphs)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 /[ ]\|.\|[ ]/ && asciiart == "no" {gsub(/\|/,"YXXY"); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 /^\|.\|[ ]/ {gsub(/\|/,"YXXY"); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 /\|\|/ {gsub(/\|\|/,"\\&#124;\\&#124;"); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 /^shellpipe/ {gsub(/\|/,"\\&#124;"); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 # pipe start
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 /[ ]\|[^ ]/ && asciiart == "no" {gsub(/ \|/," YXXY");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 gsub(/ \|/," YXXY");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 /^\|[^ ]/ {gsub(/^\|/,"YXXY");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 # pipe end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 /[^ ]\|$/ && asciiart == "no" {gsub(/\|$/,"YXXY");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 /[^ ]\|[s ,.); ]/ && asciiart == "no" {gsub(/\|/,"YXXY");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 /[^ ]\|]/ && asciiart == "no" {gsub(/\|/,"YXXY");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 # various
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 /'"/ {gsub(/'"/,"\\&#39;\\&#34;'");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 /"/ {gsub(/"/,"\\&quot;");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 /%/ {gsub(/%/,"\\&#37;");}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 NR == 1 { nf=split(FILENAME,f,".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 print "<HTML>";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 print "<HEAD>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 if ( FILENAME == "mbyte.txt" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 # needs utf-8 as uses many languages
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 print "<META HTTP-EQUIV=\"Content-type\" content=\"text/html; charset=UTF-8\">";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 # common case - Latin1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 print "<META HTTP-EQUIV=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 print "<TITLE>Vim documentation: " f[1] "</TITLE>";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 print "</HEAD>";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 print "<BODY BGCOLOR=\"#ffffff\">";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 print "<H1>Vim documentation: " f[1] "</H1>";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 print "<A NAME=\"top\"></A>";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 if ( FILENAME != "help.txt" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 print "<A HREF=\"help.html\">main help file</A>\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 print "<HR>";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 print "<PRE>";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 filename=f[1]".html";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 # set to a low value to test for few lines of text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 # NR == 99999 { exit; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 # ignore underlines and tags
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 substr($0,1,5) == " vim:" { next; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 substr($0,1,4) == "vim:" { next; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 # keep just whole lines of "-", "="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 substr($0,1,3) == "===" && substr($0,75,1) != "=" { next; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 substr($0,1,3) == "---" && substr($0,75,1) != "-" { next; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 nstar = split($0,s,"ZWWZ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 for ( i=2 ; i <= nstar ; i=i+2 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 nbla=split(s[i],blata,"[ ]");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 if ( nbla > 1 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 gsub("ZWWZ","*");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 nstar = split($0,s,"ZWWZ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 npipe = split($0,p,"YXXY");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 for ( i=2 ; i <= npipe ; i=i+2 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 nbla=split(p[i],blata,"[ ]");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 if ( nbla > 1 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 gsub("YXXY","|");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 ntabs = split($0,p,"YXXY");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 }
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 FILENAME == "gui.txt" && asciiart == "no" \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 && $0 ~ /\+----/ && $0 ~ /----\+/ {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 asciiart= "yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 asciicnt=0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 FILENAME == "quotes.txt" && asciiart == "no" \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 && $0 ~ /In summary:/ {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 asciiart= "yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 asciicnt=0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 FILENAME == "usr_20.txt" && asciiart == "no" \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 && $0 ~ /an empty line at the end:/ {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 asciiart= "yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 asciicnt=0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 asciiart == "yes" && $0=="" { asciicnt++; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 asciiart == "yes" && asciicnt == 2 { asciiart = "no"; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 asciiart == "yes" { npipe = 1; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 # { print NR " <=> " asciiart; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 # line contains "*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 nstar > 2 && npipe < 3 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 printf("\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 for ( i=1; i <= nstar ; i=i+2 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 this=s[i];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 put_this();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 ii=i+1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 nbla = split(s[ii],blata," ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 if ( ii <= nstar ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 if ( nbla == 1 && substr(s[ii],length(s[ii]),1) != " " ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 printf("*<A NAME=\"%s\"></A>",s[ii]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 printf("<B>%s</B>*",s[ii]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 printf("*%s*",s[ii]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 printf("\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 # line contains "|"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 npipe > 2 && nstar < 3 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 if ( npipe%2 == 0 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 for ( i=1; i < npipe ; i++ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 gsub("ZWWZ","*",p[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 printf("%s|",p[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 printf("%s\n",p[npipe]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 for ( i=1; i <= npipe ; i++ )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 if ( i % 2 == 1 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 gsub("ZWWZ","*",p[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 this=p[i];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 put_this();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 nfn=split(p[i],f,".");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 if ( nfn == 1 || f[2] == "" || f[1] == "" || length(f[2]) < 3 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 find_tag1();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 printf "|<A HREF=\"" f[1] ".html\">" p[i] "</A>|";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 printf("\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 # line contains both "|" and "*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 npipe > 2 && nstar > 2 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 printf("\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 for ( j=1; j <= nstar ; j=j+2 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 npipe = split(s[j],p,"YXXY");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 if ( npipe > 1 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 for ( np=1; np<=npipe; np=np+2 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 this=p[np];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 put_this();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 i=np+1;find_tag1();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 this=s[j];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 put_this();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 jj=j+1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 nbla = split(s[jj],blata," ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 if ( jj <= nstar && nbla == 1 && s[jj] != "" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 printf("*<A NAME=\"%s\"></A>",s[jj]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 printf("<B>%s</B>*",s[jj]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 if ( s[jj] != "" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 printf("*%s*",s[jj]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 printf("\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 # line contains e-mail address john.doe@some.place.edu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 $0 ~ /@/ && $0 ~ /[a-zA-Z0-9]@[a-z]/ \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 nemail=split($0,em," ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 if ( substr($0,1,1) == " " ) { printf(" "); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 for ( i=1; i <= nemail; i++ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 if ( em[i] ~ /@/ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 if ( substr(em[i],2,3) == "lt;" && substr(em[i],length(em[i])-2,3) == "gt;" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 mailaddr=substr(em[i],5,length(em[i])-8);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 printf("<A HREF=\"mailto:%s\">&lt;%s&gt;</A> ",mailaddr,mailaddr);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 if ( substr(em[i],2,3) == "lt;" && substr(em[i],length(em[i])-3,3) == "gt;" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 mailaddr=substr(em[i],5,length(em[i])-9);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 printf("<A HREF=\"mailto:%s\">&lt;%s&gt;</A>%s ",mailaddr,mailaddr,substr(em[i],length(em[i]),1));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 printf("<A HREF=\"mailto:%s\">%s</A> ",em[i],em[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 printf("%s ",em[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 #print "*** " NR " " FILENAME " - possible mail ref";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 printf("\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 # line contains http / ftp reference
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 $0 ~ /http:\/\// || $0 ~ /ftp:\/\// {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 gsub("URL:","");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 gsub("&lt;","");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 gsub("&gt;","");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 gsub("\\(","");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 gsub("\\)","");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 nemail=split($0,em," ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 for ( i=1; i <= nemail; i++ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 if ( substr(em[i],1,5) == "http:" ||
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 substr(em[i],1,4) == "ftp:" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326 if ( substr(em[i],length(em[i]),1) != "." ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 printf(" <A HREF=\"%s\">%s</A>",em[i],em[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 em[i]=substr(em[i],1,length(em[i])-1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 printf(" <A HREF=\"%s\">%s</A>.",em[i],em[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 printf(" %s",em[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 #print "*** " NR " " FILENAME " - possible http ref";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 printf("\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 # some lines contains just one "almost regular" "*"...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 nstar == 2 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 this=s[1];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 put_this();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 printf("*");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 this=s[2];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 put_this();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 printf("\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 # regular line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 { ntabs = split($0,tb," ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 for ( i=1; i < ntabs ; i++) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 this=tb[i];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 put_this();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 printf(" ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 this=tb[ntabs];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 put_this();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 printf("\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 asciiart == "yes" && $0 ~ /\+-\+--/ \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 && $0 ~ "scrollbar" { asciiart = "no"; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 END {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 topback();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 print "</PRE>\n</BODY>\n\n\n</HTML>"; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 # as main we keep index.txt (by default)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 # other candidate, help.txt
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 function topback () {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 if ( FILENAME != "tags" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 if ( FILENAME != "help.txt" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 printf("<A HREF=\"#top\">top</A> - ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 printf("<A HREF=\"help.html\">main help file</A>\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 } else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 printf("<A HREF=\"#top\">top</A>\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 function find_tag1() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 if ( p[i] == "" ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 if ( tagkey[p[i]] == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 which=tagref[p[i]];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 put_href();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 # if not found, then we have a problem
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 print "============================================" >>"errors.log";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 print FILENAME ", line " NR ", pointer: >>" p[i] "<<" >>"errors.log";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 print $0 >>"errors.log";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 which="intro.html";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 put_href();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 function see_tag() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 # ad-hoc code:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 if ( atag == "\"--" || atag == "--\"" ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 allow_one_char="no";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 if ( done == "yes" ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 rightchar=substr(atag,length(atag),1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 if ( rightchar == "." \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 || rightchar == "," \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 || rightchar == ":" \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 || rightchar == ";" \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 || rightchar == "!" \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 || rightchar == "?" \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 || rightchar == ")" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 atag=substr(atag,1,length(atag)-1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 if ( done == "yes" ) { printf("%s",rightchar);return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 leftchar=substr(atag,1,1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 lastbut1=substr(atag,length(atag),1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 if ( leftchar == "'" && lastbut1 == "'" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 allow_one_char="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 atag=substr(atag,2,length(atag)-2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 printf("%s",leftchar);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 aword=substr(atag,1,length(atag))""lastbut1""rightchar;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 if ( done == "yes" ) { printf("%s%s",lastbut1,rightchar);return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 atag=aword;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 leftchar=substr(atag,1,1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 if ( leftchar == "'" && rightchar == "'" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 allow_one_char="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 atag=substr(atag,2,length(atag)-2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 if ( atag == "<" ) { printf(" |%s|%s| ",atag,p[2]); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 printf("%s",leftchar);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460 if ( done == "yes" ) { printf("%s",rightchar);return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 printf("%s%s",atag,rightchar);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 last2=substr(atag,length(atag)-1,2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 first2=substr(atag,1,2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 if ( first2 == "('" && last2 == "')" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 allow_one_char="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 atag=substr(atag,3,length(atag)-4);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 printf("%s",first2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 if ( done == "yes" ) { printf("%s",last2);return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 printf("%s%s",atag,last2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 if ( last2 == ".)" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 atag=substr(atag,1,length(atag)-2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488 if ( done == "yes" ) { printf("%s",last2);return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 printf("%s%s",atag,last2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 if ( last2 == ")." ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 atag=substr(atag,1,length(atag)-2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 if ( done == "yes" ) { printf("%s",last2);return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 printf("%s%s",atag,last2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 first6=substr(atag,1,6);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 last6=substr(atag,length(atag)-5,6);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 if ( last6 == atag ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 last6of7=substr(atag,length(atag)-6,6);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 if ( first6 == "&quot;" && last6of7 == "&quot;" && length(atag) > 12 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 allow_one_char="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513 atag=substr(atag,7,length(atag)-13);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 printf("%s",first6);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 if ( done == "yes" ) { printf("&quot;%s",rightchar); return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522 printf("%s&quot;%s",atag,rightchar);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 if ( first6 == "&quot;" && last6 != "&quot;" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 allow_one_char="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 atag=substr(atag,7,length(atag)-6);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 if ( atag == "[" ) { printf("&quot;%s",atag); return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 if ( atag == "." ) { printf("&quot;%s",atag); return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 if ( atag == ":" ) { printf("&quot;%s",atag); return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 if ( atag == "a" ) { printf("&quot;%s",atag); return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532 if ( atag == "A" ) { printf("&quot;%s",atag); return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533 if ( atag == "g" ) { printf("&quot;%s",atag); return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536 printf("&quot;%s",atag);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539 printf("%s",first6);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541 if ( done == "yes" ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 printf("%s",atag);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 if ( last6 == "&quot;" && first6 == "&quot;" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546 allow_one_char="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 atag=substr(atag,7,length(atag)-12);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553 printf("%s",first6);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555 if ( done == "yes" ) { printf("%s",last6);return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556 printf("%s%s",atag,last6);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559 last6of7=substr(atag,length(atag)-6,6);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560 if ( last6of7 == "&quot;" && first6 == "&quot;" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561 allow_one_char="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562 atag=substr(atag,7,length(atag)-13);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563 #printf("\natag=%s,aword=%s\n",atag,aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564 if_already();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565 if ( already == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569 printf("%s",first6);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 find_tag2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571 if ( done == "yes" ) { printf("%s%s",last6of7,rightchar);return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
572 printf("%s%s%s",atag,last6of7,rightchar);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
574 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575 printf("%s",aword);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 function find_tag2() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579 done="no";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580 # no blanks present in a tag...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581 ntags=split(atag,blata,"[ ]");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 if ( ntags > 1 ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583 if ( ( allow_one_char == "no" ) && \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584 ( index("!#$%\&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",atag) !=0 ) ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 if ( skip_word[atag] == "yes" ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 if ( wasset == "yes" && lineset == NR ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589 wasset="no";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590 see_opt();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 if ( done_opt == "yes" ) {return;}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 if ( wasset == "yes" && lineset != NR ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594 wasset="no";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596 if ( atag == ":set" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597 wasset="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 lineset=NR;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 if ( tagkey[atag] == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601 which=tagref[atag];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 put_href2();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603 done="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
607 function find_tag3() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608 done="no";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609 # no blanks present in a tag...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 ntags=split(btag,blata,"[ ]");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611 if ( ntags > 1 ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612 if ( ( allow_one_char == "no" ) && \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613 ( index("!#$%\&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",btag) !=0 ) ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616 if ( skip_word[btag] == "yes" ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617 if ( tagkey[btag] == "yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618 which=tagref[btag];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619 put_href3();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620 done="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624 function put_href() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625 if ( p[i] == "" ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626 if ( which == FILENAME ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627 printf("|<A HREF=\"#%s\">%s</A>|",p[i],p[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629 else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630 nz=split(which,zz,".");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631 if ( zz[2] == "txt" || zz[1] == "tags" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 printf("|<A HREF=\"%s.html#%s\">%s</A>|",zz[1],p[i],p[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635 printf("|<A HREF=\"intro.html#%s\">%s</A>|",p[i],p[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
636 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640 function put_href2() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641 if ( atag == "" ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 if ( which == FILENAME ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643 printf("<A HREF=\"#%s\">%s</A>",atag,atag);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645 else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 nz=split(which,zz,".");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 if ( zz[2] == "txt" || zz[1] == "tags" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648 printf("<A HREF=\"%s.html#%s\">%s</A>",zz[1],atag,atag);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650 else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651 printf("<A HREF=\"intro.html#%s\">%s</A>",atag,atag);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656 function put_href3() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657 if ( btag == "" ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658 if ( which == FILENAME ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659 printf("<A HREF=\"#%s\">%s</A>",btag,btag2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661 else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662 nz=split(which,zz,".");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 if ( zz[2] == "txt" || zz[1] == "tags" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 printf("<A HREF=\"%s.html#%s\">%s</A>",zz[1],btag,btag2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666 else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 printf("<A HREF=\"intro.html#%s\">%s</A>",btag,btag2);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672 function put_this() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673 ntab=split(this,ta," ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674 for ( nta=1 ; nta <= ntab ; nta++ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675 ata=ta[nta];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676 lata=length(ata);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
677 aword="";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
678 for ( iata=1 ; iata <=lata ; iata++ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679 achar=substr(ata,iata,1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680 if ( achar != " " ) { aword=aword""achar; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681 else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682 if ( aword != "" ) { atag=aword;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683 see_tag();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684 aword="";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685 printf(" "); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686 else {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687 printf(" ");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
688 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691 if ( aword != "" ) { atag=aword;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692 see_tag();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
693 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694 if ( nta != ntab ) { printf(" "); }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 function if_already() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
699 already="no";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700 if ( npipe < 2 ) { return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701 if ( atag == ":au" && p[2] == ":autocmd" ) { already="yes";return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702 for ( npp=2 ; npp <= npipe ; npp=npp+2 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703 if ( ( (index(p[npp],atag)) != 0 \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704 && length(p[npp]) > length(atag) \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705 && length(atag) >= 1 \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706 ) \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 || (p[npp] == atag) \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
709 # printf("p=|%s|,tag=|%s| ",p[npp],atag);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710 already="yes"; return; }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714 function see_opt() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
715 done_opt="no";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
716 stag=atag;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717 nfields = split(atag,tae,"=");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
718 if ( nfields > 1 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719 btag="'"tae[1]"'";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720 btag2=tae[1];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
721 find_tag3();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722 if (done == "yes") {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
723 for ( ntae=2 ; ntae <= nfields ; ntae++ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724 printf("=%s",tae[ntae]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726 atag=stag;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 done_opt="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 btag=tae[1];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731 btag2=tae[1];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732 find_tag3();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
733 if ( done=="yes" ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734 for ( ntae=2 ; ntae <= nfields ; ntae++ ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735 printf("=%s",tae[ntae]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737 atag=stag;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738 done_opt="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742 nfields = split(atag,tae,"&quot;");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 if ( nfields > 1 ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744 btag="'"tae[1]"'";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745 btag2=tae[1];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746 find_tag3();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 if (done == "yes") {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748 printf("&quot;");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749 atag=stag;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750 done_opt="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
751 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753 btag=tae[1];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754 btag2=tae[1];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
755 find_tag3();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
756 if (done == "yes") {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757 printf("&quot;");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758 atag=stag;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 done_opt="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763 btag="'"tae[1]"'";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764 btag2=tae[1];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 find_tag3();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766 if (done == "yes") {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767 atag=stag;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768 done_opt="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771 btag=tae[1];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
772 btag2=tae[1];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773 find_tag3();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774 if (done == "yes") {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775 atag=stag;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776 done_opt="yes";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779 atag=stag;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780 }