Skip to content
Find file
795bb8b
executable file 31 lines (25 sloc) 563 Bytes
# tomd awk pre-processor (before pandoc)
# redirects {% highlight %} sections to numbered files
# and passes through <notextile> blocks
BEGIN { nme = "tomd-include-"; cnt = 0; }
/{% +highlight/ {
including = "yes";
incfile = (nme cnt++ ".txt");
print ("!include " incfile);
}
/{% +endhighlight/ {
including = "";
print >incfile;
next;
}
/^<notextile>/ {
including = "yes";
incfile = (nme cnt++ ".txt");
print ("!include " incfile);
next;
}
/^<\/notextile>/ {
including = "";
next;
}
{ if(including) { print >incfile } else { print }}
Something went wrong with that request. Please try again.