noweb is a LiterateProgramming tool. It is simple, and it works with any programming language, It can emit either LaTex or HTML. Pretty-printing is limited.
See http://www.eecs.harvard.edu/~nr/noweb/
CategoryLiterateProgramming