On Mon, Apr 26, 2010 at 11:26 PM, maxwell <maxw...@umiacs.umd.edu> wrote:
> On Mon, 26 Apr 2010 16:25:49 -0500, Grant Taylor
> <gtay...@riverviewtech.net> 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.

I can see how that could work in some simple cases. For anything other
than trivial programs, the edit-compile-run cycle would be very small
because of the inability to use an IDE or edit the source code
directly.


>  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: docbook-apps-unsubscr...@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
>
>



-- 
Ivan Ristic
ModSecurity Handbook [http://www.modsecurityhandbook.com]
SSL Labs [https://www.ssllabs.com/ssldb/]

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

Reply via email to