19 gsub(/ +/, " ", title)
20 gsub(/Committee Draft --/, "", title)
24 ss[sid] = ss[sid] "</pre>\n"
29 seencontents && !seenfore && /^[^@]/ {
36 if (!sub(/ +\. .*/, "", s)) {
43 if (match(s, /<[a-zA-Z0-9_]*\.h>/)) {
44 h = substr($0,RSTART,RLENGTH)
49 s = "<a href=\"#" id "\">" s "</a>\n"
52 n = split(id, a, /\./)
67 ss[sid] = ss[sid] "</ul>\n"
77 ss[sid] = ss[sid] "</pre>\n"
81 ss[sid] = ss[sid] "<h1>" $0 "</h1>\n"
83 ss[sid] = ss[sid] "<pre>\n"
90 slevel = split($2,a,/\./)+1
95 # todo hX, back to top
96 ss[sid] = sprintf("<h%s><a name=\"%s\" href=\"#%s\">%s</a></h%s>\n", slevel, sect, sect, $0, slevel)
98 ss[sid] = ss[sid] "<pre>\n"
103 ss[sid] = ss[sid] "<ul>\n"
107 ss[sid] = ss[sid] "</ul>\n"
111 ss[sid] = ss[sid] "<ol>\n"
115 ss[sid] = ss[sid] "</ol>\n"
120 ss[sid] = ss[sid] "<li>"
134 note[nn] = note[nn] "\n" pre
136 ss[sid] = ss[sid] pre
151 ss[sid] = ss[sid] "<!--page " p " -->\n"
156 ss[sid] = ss[sid] "<p><!--para " $2 " -->\n"
160 /^ *(Syntax|Semantics|Description|Constraints|Synopsis|Returns)$/ {
161 ss[sid] = ss[sid] "<h6>" $0 "</h6>\n"
166 ss[sid] = ss[sid] $0 "\n"
174 r = " [A-Z1-9][0-9.]*"
176 r = "[ ([][A-Z1-9]\\.[0-9.]*[0-9]"
179 while (match(s, r)) {
180 p = p substr(s,1,RSTART)
181 m = substr(s,RSTART+1,RLENGTH-1)
182 if (m ~ /\.0$/ || m ~ /[4-9][0-9]/ || m ~ /[0-3][0-9][0-9]/ ||
183 substr(s,RSTART+RLENGTH,1) ~ /[a-zA-Z_\-]/)
186 p = p "<a href=\"#" m "\">" m "</a>"
187 s = substr(s,RSTART+RLENGTH)
191 while (match(s, /[Aa]nnex [A-Z]/)) {
192 p = p substr(s,1,RSTART-1)
193 m = substr(s,RSTART,RLENGTH)
194 p = p "<a href=\"#" substr(m,RLENGTH,1) "\">" m "</a>"
195 s = substr(s,RSTART+RLENGTH)
199 while (match(s, /<[a-zA-Z0-9_]*\.h>/)) {
200 p = p substr(s,1,RSTART-1)
201 m = substr(s,RSTART,RLENGTH)
203 p = p "<a href=\"#" header[m] "\">" m "</a>"
206 s = substr(s,RSTART+RLENGTH)
210 while (match(s, noteid "\\)")) {
211 if (noteid==1 && s !~ /\.1\)/)
213 p = p substr(s,1,RSTART-1)
214 p = p "<sup><a href=\"#note" noteid "\"><b>" noteid ")</b></a></sup>"
215 snote[sid] = snote[sid] " " noteid
217 s = substr(s,RSTART+RLENGTH)
220 sub(/^ *Forward references/, "<p><b>&</b>", s)
224 note[nn] = note[nn] s "\n"
226 ss[sid] = ss[sid] s "\n"
230 ss[sid] = ss[sid] "</pre>"
232 print "<html><head><title>" title "</title></head><body>"
234 for (i = 1; i <= sid; i++) {
236 n = split(snote[i],a)
238 s = "<h6>footnotes</h6>\n"
239 for (j = 1; j <= n; j++) {
240 s = s "<p><small><a name=\"note" a[j] "\" href=\"#note" a[j] "\">" a[j] ")</a>" note[a[j]+0] "</small>\n"
246 print "</body></html>"