Mercurial > vim
comparison runtime/doc/maketags.awk @ 7:3fc0f57ecb91 v7.0001
updated for version 7.0001
author | vimboss |
---|---|
date | Sun, 13 Jun 2004 20:20:40 +0000 |
parents | |
children | aa539262b6a7 |
comparison
equal
deleted
inserted
replaced
6:c2daee826b8f | 7:3fc0f57ecb91 |
---|---|
1 BEGIN { FS=" "; } | |
2 | |
3 NR == 1 { nf=split(FILENAME,f,".") | |
4 print "<HTML>"; | |
5 print "<HEAD><TITLE>" f[1] "</TITLE></HEAD>"; | |
6 print "<BODY BGCOLOR=\"#ffffff\">"; | |
7 print "<H1>Vim Documentation: " f[1] "</H1>"; | |
8 print "<A NAME=\"top\"></A>"; | |
9 print "<HR>"; | |
10 print "<PRE>"; | |
11 } | |
12 | |
13 { | |
14 # | |
15 # protect special chars | |
16 # | |
17 gsub(/&/,"\\&"); | |
18 gsub(/>/,"\\>"); | |
19 gsub(/</,"\\<"); | |
20 gsub(/"/,"\\""); | |
21 gsub(/%/,"\\%"); | |
22 | |
23 nf=split($0,tag," "); | |
24 tagkey[t]=tag[1];tagref[t]=tag[2];tagnum[t]=NR; | |
25 print $1 " " $2 " line " NR >"tags.ref" | |
26 n=split($2,w,"."); | |
27 printf ("|<A HREF=\"%s.html#%s\">%s</A>| %s\n",w[1],$1,$1,$2); | |
28 } | |
29 | |
30 END { | |
31 topback(); | |
32 print "</PRE>\n</BODY>\n\n\n</HTML>"; | |
33 } | |
34 | |
35 # | |
36 # as main we keep index.txt (by default) | |
37 # other candidate, help.txt | |
38 # | |
39 function topback () { | |
40 printf("<A HREF=\"#top\">top</A> - "); | |
41 printf("<A HREF=\"help.html\">back to help</A>\n"); | |
42 } |