Douglas Gregor wrote:
> On Thursday 04 March 2004 03:22 am, Vladimir Prus wrote:
> > Hello,
> > I'm documenting a library, and would like to include an example in
> > tutorial. I already have the example as .cpp file, so the question is:
> > how to include that .cpp file into documentation. Is there something like
> >
> >    <include-example href="../examples/multiple_sources.cpp"/>
> >
> > ? Do I have any alternatives other than copy-paste?
>
> Nothing that I know of. The way I've been doing it for test cases is
> exactly the opposite, where all of the code is in the BoostBook XML and we
> build the .cpp files from it. This lets me more easily talk about program
> snippets in the tutorial text (see, e.g., Boost.Function) and put them into
> an actual test case for regression testing. It's the literate programming
> approach, essentially.

Unfortunately, when examples are somewhat large (100 lines), I'd like to avoid 
including full text in docs. IIRC, LaTex has some module which allows to 
include specific lines of a program and add highlighting to it. Would be nice 
to have something like that. But I realize this might not be easy.

- Volodya



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Boost-docs mailing list
[EMAIL PROTECTED]
Unsubscribe and other administrative requests: 
https://lists.sourceforge.net/lists/listinfo/boost-docs

Reply via email to