Boris | 7 Jul 20:01

Including a few lines from another file in BoostBook?

I've been converting a Quickbook documentation to DocBook. In some  
Quickbook files I've seen some references to source files where only a  
part of the source file seems to be included - something like this:

[include ../example/tutorial.cpp c++ include-headers]

This sounds like a good idea as the source file is complete (and can be  
automatically built and tested) but only the few lines are included which  
are relevant. I wonder though if this can be done with DocBook, too (or  
BoostBook)?

Boris
Eric Niebler | 7 Jul 20:22

Re: Including a few lines from another file in BoostBook?

Boris wrote:
> I've been converting a Quickbook documentation to DocBook. 

Do you mind if I ask why?

> In some 
> Quickbook files I've seen some references to source files where only a 
> part of the source file seems to be included - something like this:
> 
> [include ../example/tutorial.cpp c++ include-headers]
> 
> This sounds like a good idea as the source file is complete (and can be 
> automatically built and tested) but only the few lines are included 
> which are relevant. I wonder though if this can be done with DocBook, 
> too (or BoostBook)?

I don't think so. DocBook (and BoostBook) are just XML. You can 
xi:include other XML files and select bits of them with XPointer, but 
XML doesn't know anything about C++ source.

--

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com
Frank Mori Hess | 7 Jul 20:31
Favicon

Re: Including a few lines from another file in BoostBook?


On Monday 07 July 2008 14:22 pm, Eric Niebler wrote:
> I don't think so. DocBook (and BoostBook) are just XML. You can
> xi:include other XML files and select bits of them with XPointer, but
> XML doesn't know anything about C++ source.

You can put an xi:include of a source code file inside a programlisting 
element though.
Boris | 7 Jul 22:03

Re: Including a few lines from another file in BoostBook?

On Mon, 07 Jul 2008 20:31:09 +0200, Frank Mori Hess <frank.hess <at> nist.gov>  
wrote:

> On Monday 07 July 2008 14:22 pm, Eric Niebler wrote:
>> I don't think so. DocBook (and BoostBook) are just XML. You can
>> xi:include other XML files and select bits of them with XPointer, but
>> XML doesn't know anything about C++ source.
>
> You can put an xi:include of a source code file inside a programlisting
> element though.

But can you xi:include only a part of a source code file? You can include  
a range with XInclude but not when parse="text"?

Boris
Frank Mori Hess | 8 Jul 14:46
Favicon

Re: Including a few lines from another file in BoostBook?


On Monday 07 July 2008 16:03 pm, Boris wrote:
> On Mon, 07 Jul 2008 20:31:09 +0200, Frank Mori Hess <frank.hess <at> nist.gov>
> >
> > You can put an xi:include of a source code file inside a programlisting
> > element though.
>
> But can you xi:include only a part of a source code file? You can include
> a range with XInclude but not when parse="text"?

No, I think you have to include the whole file.
Boris | 8 Jul 10:54

Re: Including a few lines from another file in BoostBook?

On Mon, 07 Jul 2008 20:22:44 +0200, Eric Niebler  
<eric <at> boost-consulting.com> wrote:

> Boris wrote:
>> I've been converting a Quickbook documentation to DocBook.
>
> Do you mind if I ask why?

I took over a library (not yet an official Boost library), and as I'm much  
more familiar with DocBook I converted the QuickBook files. It also seemed  
to me that BoostBook is now the official documentation format while  
QuickBook is older? When I was trying to find out how to document a Boost  
library correctly I was also referred to BoostBook.

Boris

> [...]
Eric Niebler | 8 Jul 16:57

Re: Including a few lines from another file in BoostBook?

Boris wrote:
> On Mon, 07 Jul 2008 20:22:44 +0200, Eric Niebler 
> <eric <at> boost-consulting.com> wrote:
> 
>> Boris wrote:
>>> I've been converting a Quickbook documentation to DocBook.
>>
>> Do you mind if I ask why?
> 
> I took over a library (not yet an official Boost library), and as I'm 
> much more familiar with DocBook I converted the QuickBook files. It also 
> seemed to me that BoostBook is now the official documentation format 
> while QuickBook is older? When I was trying to find out how to document 
> a Boost library correctly I was also referred to BoostBook.

Ah, no. QuickBook is a simple front-end for BoostBook. It is a 
relatively new addition to the toolchain, and is intended to make 
authoring Boost documentation easier. Many Boost library authors are 
moving away from using BoostBook directly and are instead moving toward 
QuickBook.

--

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com
Rene Rivera | 8 Jul 16:58

Re: Including a few lines from another file in BoostBook?

Boris wrote:
> On Mon, 07 Jul 2008 20:22:44 +0200, Eric Niebler 
> <eric <at> boost-consulting.com> wrote:
> 
>> Boris wrote:
>>> I've been converting a Quickbook documentation to DocBook.
>>
>> Do you mind if I ask why?
> 
> I took over a library (not yet an official Boost library), and as I'm 
> much more familiar with DocBook I converted the QuickBook files. It also 
> seemed to me that BoostBook is now the official documentation format 
> while QuickBook is older? When I was trying to find out how to document 
> a Boost library correctly I was also referred to BoostBook.

QuickBook is not older than BoostBook. QBK was adapted from an existing 
program to output BoostBook as writing DocBook is a PITA (without some 
for of program help).

--

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org (msn) - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim,yahoo,skype,efnet,gmail

Gmane