projects
/
c-standard
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bold common headings Syntax|Synopsis|..
[c-standard]
/
tohtml.sh
diff --git
a/tohtml.sh
b/tohtml.sh
index
cf86abc
..
504d92a
100755
(executable)
--- a/
tohtml.sh
+++ b/
tohtml.sh
@@
-46,7
+46,8
@@
BEGIN {
if (id ~ /Annex/)
id = $2
if (($0 ~ /^ [1-9]\./ || id ~ /^([A-Z]|[1-9A-Z]\.[1-9][0-9.]*|Index|Foreword|Introduction|Bibliography)$/) &&
if (id ~ /Annex/)
id = $2
if (($0 ~ /^ [1-9]\./ || id ~ /^([A-Z]|[1-9A-Z]\.[1-9][0-9.]*|Index|Foreword|Introduction|Bibliography)$/) &&
- (NF==1 || $2 ~ /^[A-Z]/)) {
+ (NF==1 || $2 ~ /^[A-Z]/) &&
+ ($0 !~ /^ *[0-9.]+[^0-9]$/)) {
if (id ~ /\.$/)
id = substr(id,1,length(id)-1)
print "<a name=\"" id "\" href=\"#" id "\"><b>" $0 "</b></a>"
if (id ~ /\.$/)
id = substr(id,1,length(id)-1)
print "<a name=\"" id "\" href=\"#" id "\"><b>" $0 "</b></a>"
@@
-62,6
+63,11
@@
BEGIN {
next
}
next
}
+/^ *(Syntax|Semantics|Description|Constraints|Synopsis|Returns)$/ {
+ print "<b>" $0 "</b>"
+ next
+}
+
{
s = $0
p = ""
{
s = $0
p = ""
@@
-72,7
+78,7
@@
BEGIN {
while (match(s, r)) {
p = p substr(s,1,RSTART)
m = substr(s,RSTART+1,RLENGTH-1)
while (match(s, r)) {
p = p substr(s,1,RSTART)
m = substr(s,RSTART+1,RLENGTH-1)
- if (m ~ /[4-9][0-9]/ || m ~ /[0-3][0-9][0-9]/ || substr(s,RSTART+RLENGTH,1) ~ /[a-zA-Z\-]/)
+ if (m ~ /
\.0$/ || m ~ /
[4-9][0-9]/ || m ~ /[0-3][0-9][0-9]/ || substr(s,RSTART+RLENGTH,1) ~ /[a-zA-Z\-]/)
p = p m
else
p = p "<a href=\"#" m "\">" m "</a>"
p = p m
else
p = p "<a href=\"#" m "\">" m "</a>"