pipadoc, make index generation optional in HEAD and PARA
authorChristian Thaeter <ct@pipapo.org>
Thu, 3 Sep 2009 20:18:32 +0000 (22:18 +0200)
committerChristian Thaeter <ct@pipapo.org>
Fri, 4 Sep 2009 04:32:04 +0000 (06:32 +0200)
just generate an anchor if no index description is given

doc/asciidoc.pawk

index 0cd3391..22aa6a1 100644 (file)
@@ -13,7 +13,7 @@ match($0, com "([[:alpha:]][[:alnum:]_]*)(([.]([^[:space:]]*)))?", p) {
 match($0, com"(.*) PARA (.*); *(.*); *(.*)", p) {
     if(p[3])
     {
-        append("index", tolower(p[3]), "xref:"p[3]"["p[2]"]:: "p[4])
+        if (p[4]) append("index", tolower(p[3]), "xref:"p[3]"["p[2]"]:: "p[4])
         append(p[1],"","[["p[3]"]]")
     }
     append(p[1],"","."p[2])
@@ -59,7 +59,7 @@ match($0, com"(.*) HEAD([^ ]+) (.*); *(.*); *(.*)", p) {
     {
         if (p[4])
         {
-            append("index", tolower(p[4]), "xref:"p[4]"["p[3]"]:: "p[5])
+            if (p[5]) append("index", tolower(p[4]), "xref:"p[4]"["p[3]"]:: "p[5])
             append(p[1],"","[["p[4]"]]")
         }
         append(p[1],"",p[3])