Texinfo is a hypertext file format that can be used to produce
book-like texts. A piece of Perl on the
MeatBall:EmacsWiki does this
now (one of the output formats one can generate from Texinfo is Info
-- and Info can be read comfortably within Emacs). See
MeatBall:BookMetaphor for more information.
This uses code to ExtractingText which might be useful in other
contexts as well.