projects
/
c-standard
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
manually fix n1570.html, fix x^y in cpow for n1256.html
[c-standard]
/
ann2html.sh
diff --git
a/ann2html.sh
b/ann2html.sh
index
a4c127c
..
f7edb9b
100755
(executable)
--- a/
ann2html.sh
+++ b/
ann2html.sh
@@
-8,12
+8,16
@@
BEGIN {
ss[sid] = "<pre>"
}
ss[sid] = "<pre>"
}
-{
+
function esc()
{
gsub(/\&/, "\\&")
gsub(/</, "\\<")
gsub(/>/, "\\>")
}
gsub(/\&/, "\\&")
gsub(/</, "\\<")
gsub(/>/, "\\>")
}
+{
+ esc()
+}
+
!title && /^[^@]/ {
title = $0
gsub(/ +/, " ", title)
!title && /^[^@]/ {
title = $0
gsub(/ +/, " ", title)
@@
-35,6
+39,7
@@
seencontents && !seenfore && /^[^@]/ {
s = $0
if (!sub(/ +\. .*/, "", s)) {
getline
s = $0
if (!sub(/ +\. .*/, "", s)) {
getline
+ esc()
sub(/^ */, " ")
s = s $0
sub(/ +\. .*/, "", s)
sub(/^ */, " ")
s = s $0
sub(/ +\. .*/, "", s)
@@
-78,6
+83,7
@@
seencontents && !seenfore && /^[^@]/ {
}
sid++
getline
}
sid++
getline
+ esc()
ss[sid] = ss[sid] "<h1>" $0 "</h1>\n"
if (!seencontents) {
ss[sid] = ss[sid] "<pre>\n"
ss[sid] = ss[sid] "<h1>" $0 "</h1>\n"
if (!seencontents) {
ss[sid] = ss[sid] "<pre>\n"
@@
-96,6
+102,7
@@
seencontents && !seenfore && /^[^@]/ {
slevel = 5
sect = $2
getline
slevel = 5
sect = $2
getline
+ esc()
# todo hX, back to top
ss[sid] = sprintf("<h%s><a name=\"%s\" href=\"#%s\">%s</a></h%s>\n", slevel, sect, sect, $0, slevel)
if ($0 == "Index")
# todo hX, back to top
ss[sid] = sprintf("<h%s><a name=\"%s\" href=\"#%s\">%s</a></h%s>\n", slevel, sect, sect, $0, slevel)
if ($0 == "Index")
@@
-157,7
+164,7
@@
seencontents && !seenfore && /^[^@]/ {
}
/^@para/ {
}
/^@para/ {
- ss[sid] = ss[sid]
"<p><!--para " $2 " -->\n"
+ ss[sid] = ss[sid]
sprintf("<p><a name=\"%sp%s\" href=\"#%sp%s\"><small>%s</small></a>\n", sect, $2, sect, $2, $2)
next
}
next
}
@@
-261,6
+268,7
@@
END {
}
print s
}
}
print s
}
+ print "<p><small><a href=\"#Contents\">Contents</a></small>"
}
print "</body></html>"
}
print "</body></html>"