make indexes optional for the asciidoc plugin of pipadoc
[nobug.git] / doc / asciidoc.pawk
blob71bafb14d23dbc076fbd30f58e0b628c21aaedc7
2 # Create an asciidoc paragraph and index entry
3 #             Sec       Name  Index Explanation
4 match($0, com"(.*) PARA (.*); *(.*); *(.*)", p) {
5     if(p[3])
6     {
7         append("index", tolower(p[3]), "xref:"p[3]"["p[2]"]:: "p[4])
8         append(p[1],"","[["p[3]"]]")
9     }
10     append(p[1],"","."p[2])
11     next
14 # Create an asciidoc headline and index entry
15 #             Sec      Typ Name  Index Explanation
16 match($0, com"(.*) HEAD(.) (.*); *(.*); *(.*)", p) {
17     if (p[4])
18     {
19         append("index", tolower(p[4]), "xref:"p[4]"["p[3]"]:: "p[5])
20         append(p[1],"","[["p[4]"]]")
21     }
22     append(p[1],"",p[3])
23     append(p[1],"",gensub(/./, p[2], "g", p[3]))
24     next