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"
94 slevel = split($2,a,/\./)+1
99 # todo hX, back to top
100 ss[sid] = sprintf("<h%s><a name=\"%s\" href=\"#%s\">%s</a></h%s>\n", slevel, sect, sect, $0, slevel)
102 ss[sid] = ss[sid] "<pre>\n"
107 ss[sid] = ss[sid] "<ul>\n"
111 ss[sid] = ss[sid] "</ul>\n"
115 ss[sid] = ss[sid] "<ol>\n"
119 ss[sid] = ss[sid] "</ol>\n"
124 ss[sid] = ss[sid] "<li>"
138 note[nn] = note[nn] "\n" pre
140 ss[sid] = ss[sid] pre
155 ss[sid] = ss[sid] "<!--page " p " -->\n"
160 ss[sid] = ss[sid] "<p><!--para " $2 " -->\n"
164 /^ *(Syntax|Semantics|Description|Constraints|Synopsis|Returns|Recommended practice|Implementation limits)$/ {
165 ss[sid] = ss[sid] "<h6>" $0 "</h6>\n"
170 ss[sid] = ss[sid] $0 "\n"
178 r = " [A-Z1-9][0-9.]*"
180 r = "[ ([][A-Z1-9]\\.[0-9.]*[0-9]"
183 while (match(s, r)) {
184 p = p substr(s,1,RSTART)
185 m = substr(s,RSTART+1,RLENGTH-1)
186 if (m ~ /\.0$/ || m ~ /[4-9][0-9]/ || m ~ /[0-3][0-9][0-9]/ ||
187 substr(s,RSTART+RLENGTH,1) ~ /[a-zA-Z_\-]/)
190 p = p "<a href=\"#" m "\">" m "</a>"
191 s = substr(s,RSTART+RLENGTH)
195 while (match(s, /[Aa]nnex [A-Z]/)) {
196 p = p substr(s,1,RSTART-1)
197 m = substr(s,RSTART,RLENGTH)
198 p = p "<a href=\"#" substr(m,RLENGTH,1) "\">" m "</a>"
199 s = substr(s,RSTART+RLENGTH)
203 while (match(s, /<[a-zA-Z0-9_]*\.h>/)) {
204 p = p substr(s,1,RSTART-1)
205 m = substr(s,RSTART,RLENGTH)
207 p = p "<a href=\"#" header[m] "\">" m "</a>"
210 s = substr(s,RSTART+RLENGTH)
214 while (match(s, noteid "\\)")) {
215 if (noteid==1 && s !~ /\.1\)/)
217 p = p substr(s,1,RSTART-1)
218 p = p "<sup><a href=\"#note" noteid "\"><b>" noteid ")</b></a></sup>"
219 snote[sid] = snote[sid] " " noteid
221 s = substr(s,RSTART+RLENGTH)
224 sub(/^ *Forward references/, "<p><b>&</b>", s)
226 s = "<b>" s "</b><br>"
232 note[nn] = note[nn] s "\n"
234 ss[sid] = ss[sid] s "\n"
238 ss[sid] = ss[sid] "</pre>"
240 print "<html><head><title>" title "</title></head><body>"
242 for (i = 1; i <= sid; i++) {
244 n = split(snote[i],a)
246 s = "<h6>footnotes</h6>\n"
247 for (j = 1; j <= n; j++) {
248 s = s "<p><small><a name=\"note" a[j] "\" href=\"#note" a[j] "\">" a[j] ")</a>" note[a[j]+0] "</small>\n"
254 print "</body></html>"