On Mon, 26 Apr 2010 16:25:49 -0500, Grant Taylor
<[email protected]> wrote:
> Can you not have all your examples in separate source files?
> 
> You might need a pre-processor to include them together when compiling 
> your source code.  Can you compile your source code as is or are some of

> the sections duplicate?

Sounds like a job for Literate Programming.  Instead of keeping your
source code and examples in external file(s), keep them in your DocBook
document, and extract them automagically to produce the source code in the
programming language.  The implementation that Norm Walsh did several years
back, for an earlier version of DocBook, can easily be adapted to DB5.  It
assumes you only want to get a single source code file out, but could
easily be adopted to allow for extracting ("tangling") multiple output
files.

We're using this for grammars of natural languages; the individual grammar
rules scattered throughout our prose grammar get tangled into an XML
document, which we further process into another target language.  But the
tangled doc can be in any programming language.

   Mike Maxwell

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to