Introduction

Fangle is a literate programming technique for TeXmacs, Lyx and Latex inspired by notangle.

Literate programming means that instead of commenting your code (or feeling guilty for not doing so) you code your comments. Or rather you write a book about the problem your program solves, and in the narrative of the book you introduce aspects of code that solve the problem. As you do this you slowly reveal the solution - a well documented solution!

Literate programming helps one to write good code, because if one can't write a good justification or explanation for one's code, it makes one think again and write something that one can explain.

See this hello-world example in PDF rendering. The narrative explains hello-world as well as TeXmacs literate programming.

Fangle comes in two parts.

The weave part produces the formatted document is implemented entirely in TeXmacs macros (for TeXmacs) and Latex macros for Lyx.

The tangle part generates the source code is implemented in awk for portability across most unix-like or windows systems.

Naturally, fangle is written using literate programming techniques, using itself, and so the source is also the documentation.

The source was written using the Lyx document editor (an excellent front end to Latex) and then converted for TeXmacs which has a better WYSIWYG macro rendering system. TeXmacs and Lyx are not required, but fangle provides formatting support for TeXmacs and Lyx.

Features