21 gsub(/ +/, " ", title)
22 gsub(/Committee Draft --/, "", title)
26 ss[sid] = ss[sid] "</pre>\n"
31 seencontents && !seenfore && /^[^@]/ {
38 if (!sub(/ +\. .*/, "", s)) {
45 if (match(s, /<[a-zA-Z0-9_]*\.h>/)) {
46 h = substr($0,RSTART,RLENGTH)
51 s = "<a href=\"#" id "\">" s "</a>\n"
54 n = split(id, a, /\./)
69 ss[sid] = ss[sid] "</ul>\n"
79 ss[sid] = ss[sid] "</pre>\n"
83 ss[sid] = ss[sid] "<h1>" $0 "</h1>\n"
85 ss[sid] = ss[sid] "<pre>\n"
96 slevel = split($2,a,/\./)+1
101 # todo hX, back to top
102 ss[sid] = sprintf("<h%s><a name=\"%s\" href=\"#%s\">%s</a></h%s>\n", slevel, sect, sect, $0, slevel)
104 ss[sid] = ss[sid] "<pre>\n"
109 ss[sid] = ss[sid] "<ul>\n"
113 ss[sid] = ss[sid] "</ul>\n"
117 ss[sid] = ss[sid] "<ol>\n"
121 ss[sid] = ss[sid] "</ol>\n"
126 ss[sid] = ss[sid] "<li>"
140 note[nn] = note[nn] "\n" pre
142 ss[sid] = ss[sid] pre
157 ss[sid] = ss[sid] "<!--page " p " -->\n"
162 ss[sid] = ss[sid] "<p><!--para " $2 " -->\n"
166 /^ ?(Syntax|Semantics|Description|Constraints|Synopsis|Returns|Recommended practice|Implementation limits|Environmental limits)$/ {
167 ss[sid] = ss[sid] "<h6>" $0 "</h6>\n"
172 ss[sid] = ss[sid] $0 "\n"
180 r = " [A-Z1-9][0-9.]*"
182 r = "[ ([][A-Z1-9]\\.[0-9.]*[0-9]"
185 while (match(s, r)) {
186 p = p substr(s,1,RSTART)
187 m = substr(s,RSTART+1,RLENGTH-1)
188 if (m ~ /\.0$/ || m ~ /[4-9][0-9]/ || m ~ /[0-3][0-9][0-9]/ ||
189 substr(s,RSTART+RLENGTH,1) ~ /[a-zA-Z_\-]/)
192 p = p "<a href=\"#" m "\">" m "</a>"
193 s = substr(s,RSTART+RLENGTH)
197 while (match(s, /[Aa]nnex [A-Z]/)) {
198 p = p substr(s,1,RSTART-1)
199 m = substr(s,RSTART,RLENGTH)
200 p = p "<a href=\"#" substr(m,RLENGTH,1) "\">" m "</a>"
201 s = substr(s,RSTART+RLENGTH)
205 while (match(s, /<[a-zA-Z0-9_]*\.h>/)) {
206 p = p substr(s,1,RSTART-1)
207 m = substr(s,RSTART,RLENGTH)
209 p = p "<a href=\"#" header[m] "\">" m "</a>"
212 s = substr(s,RSTART+RLENGTH)
217 while (match(s, noteid-1 "\\)")) {
218 p = p substr(s,1,RSTART-1)
219 p = p "<sup><a href=\"#note" noteid-1 "\"><b>" noteid-1 ")</b></a></sup>"
220 s = substr(s,RSTART+RLENGTH)
222 if (!match(s, noteid "\\)"))
224 if (noteid==1 && s !~ /\.1\)/)
226 p = p substr(s,1,RSTART-1)
227 p = p "<sup><a href=\"#note" noteid "\"><b>" noteid ")</b></a></sup>"
228 snote[sid] = snote[sid] " " noteid
230 s = substr(s,RSTART+RLENGTH)
233 sub(/^ *Forward references/, "<p><b>&</b>", s)
235 s = "<b>" s "</b><br>"
241 note[nn] = note[nn] s "\n"
243 ss[sid] = ss[sid] s "\n"
247 ss[sid] = ss[sid] "</pre>"
249 print "<html><head><title>" title "</title></head><body>"
251 for (i = 1; i <= sid; i++) {
253 n = split(snote[i],a)
255 s = "<h6>footnotes</h6>\n"
256 for (j = 1; j <= n; j++) {
257 s = s "<p><small><a name=\"note" a[j] "\" href=\"#note" a[j] "\">" a[j] ")</a>" note[a[j]+0] "</small>\n"
263 print "</body></html>"