From efc51bc36623553afd23b65a4cd3e859d6702183 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Sat, 29 Aug 2009 23:02:59 +0200 Subject: [PATCH] include source file and line number comments by asciidoc.pawk --- doc/asciidoc.pawk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/asciidoc.pawk b/doc/asciidoc.pawk index 71bafb1..02c4839 100644 --- a/doc/asciidoc.pawk +++ b/doc/asciidoc.pawk @@ -1,4 +1,13 @@ +# include asciidoc comments about filename and linenumber in generated document +match($0, com "([[:alpha:]][[:alnum:]_]*)(([.]([^[:space:]]*)))?", p) { + if(p[1] != old_index) + { + old_index = p[1] + append(p[1], p[4], "// "FILENAME ":" FNR " //") + } +} + # Create an asciidoc paragraph and index entry # Sec Name Index Explanation match($0, com"(.*) PARA (.*); *(.*); *(.*)", p) { @@ -23,3 +32,4 @@ match($0, com"(.*) HEAD(.) (.*); *(.*); *(.*)", p) { append(p[1],"",gensub(/./, p[2], "g", p[3])) next } + -- 2.11.4.GIT