Literate programming/Bird conversion via awk
< Literate programming
Jump to navigation
Jump to search
Revision as of 17:21, 9 October 2006 by BrettGiles (talk | contribs) (Breaking out from main literate programming page)
Thanks to Peter Tillier from the comp.lang.awk newsgroup.
# bird2code.awk ^[^>] || ^$ {print; next} ^> { print "\\begin{code}" sub(/^> /,"") print rc = getline while(($0 ~ ^>) && (rc > 0)) { sub(/^> /,"") print rc = getline } print "\\end{code}\n" }