cosmetic change (h6 is small on modern browsers)
[c-standard] / ann2html.sh
index 500e36a..a4c127c 100755 (executable)
@@ -133,7 +133,7 @@ seencontents && !seenfore && /^[^@]/ {
 /^@end pre/ {
        if (!pre)
                next
-       pre = pre "</pre>\n"
+       pre = pre "\n</pre>\n"
        if (nn)
                note[nn] = note[nn] "\n" pre
        else
@@ -162,7 +162,7 @@ seencontents && !seenfore && /^[^@]/ {
 }
 
 /^ ?(Syntax|Semantics|Description|Constraints|Synopsis|Returns|Recommended practice|Implementation limits|Environmental limits)$/ {
-       ss[sid] = ss[sid] "<h6>" $0 "</h6>\n"
+       ss[sid] = ss[sid] "<p><b>" $0 "</b>\n"
        next
 }
 
@@ -211,6 +211,11 @@ seencontents && !seenfore && /^[^@]/ {
        }
        s = p s
        p = ""
+       # TODO: false positives..
+       while (match(s, /[a-z]opt[ )"]/))
+               s = substr(s,1,RSTART) "<sub>opt</sub>" substr(s,RSTART+RLENGTH-1)
+       if (match(s, /[a-z]opt$/))
+               s = substr(s,1,RSTART) "<sub>opt</sub>"
        for (;;) {
                while (match(s, noteid-1 "\\)")) {
                        p = p substr(s,1,RSTART-1)
@@ -250,7 +255,7 @@ END {
                print ss[i]
                n = split(snote[i],a)
                if (n > 0) {
-                       s = "<h6>footnotes</h6>\n"
+                       s = "<p><b>Footnotes</b>\n"
                        for (j = 1; j <= n; j++) {
                                s = s "<p><small><a name=\"note" a[j] "\" href=\"#note" a[j] "\">" a[j] ")</a>" note[a[j]+0] "</small>\n"
                        }