# Create an asciidoc paragraph and index entry
# Sec Name Index Explanation
match($0, com"(.*) PARA (.*); (.*); *(.*)", p) {
- append("index", p[3], "xref:"p[3]"["p[2]"]:: "p[4])
+ append("index", tolower(p[3]), "xref:"p[3]"["p[2]"]:: "p[4])
append(p[1],"","[["p[3]"]]")
append(p[1],"","."p[2])
next
# Create an asciidoc headline and index entry
# Sec Typ Name Index Explanation
match($0, com"(.*) HEAD(.) (.*); (.*); *(.*)", p) {
- append("index", p[4], "xref:"p[4]"["p[3]"]:: "p[5])
+ append("index", tolower(p[4]), "xref:"p[4]"["p[3]"]:: "p[5])
append(p[1],"","[["p[4]"]]")
append(p[1],"",p[3])
append(p[1],"",gensub(/./, p[2], "g", p[3]))
function append(idx, sort, text)
{
if (idx in maybe)
- maybe[idx] = maybe[idx] "\n.. " text
+ maybe[idx] = maybe[idx] "\n."sort" " text
else
maybe[idx] = "."sort" "text
}
# record all other comments which may be candidate comments
match(\$0, "(.*)" com "([[:alpha:]][[:alnum:]_]*)(([.]([^[:space:]]*)))?([[:space:]](.*))?", m) && m[1] !~ com {
- #print "append("m[2]"," m[5] "," m[7]")"
-
append(m[2], m[5] , m[7])
next
}
print output[i]
else
{
- nelements = split(maybe[subst[i]], s, "\n[.]")
- split("", tosort)
+ nelements = split(maybe[subst[i]], s, "\n")
+ delete tosort
+ #split("", tosort)
- for (j=1; j <=nelements; ++j)
+ for (j=1; j <= nelements; ++j)
{
- match(s[j], ".([^[:space:]]*) (.*)", entries)
+ match(s[j], "[.]([^[:space:]]*) (.*)", entries)
- if ("." entries[1] in tosort)
- tosort["." entries[1]] = tosort["." entries[1]] "\n" entries[2]
+ if (entries[1] in tosort)
+ tosort[entries[1]] = tosort[entries[1]] "\n" entries[2]
else
- tosort["." entries[1]] = entries[2]
+ tosort[entries[1]] = entries[2]
}
elements = asorti(tosort, sorted)