OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Programlisting of only part of a file


Uh, I am thinking you would need a well formed XML file to actually
use processing instructions. This would mean having large CDATA
sections separating the PIs. It might be easier to use your favorite
programming language to simply scan the source for the relevant begin
and end markers and have it splice that section into a separate file
at documentation build time.

On 10/16/06, Nelson, Dean <dean.nelson@eecradar.com> wrote:
> So I assume that there is no "trick of the Jedi Masters" that will work
> here other than preprocessing with XSLT?
>
> This would be a good thing to have in Docbook, as source code
> documentation is a basic function of many code maintainers. Since the
> code could change at any time, placing a locator id in the code would be
> nice. Something like:
>
> /*
> <?db-code-id="main-routine"?>
> */
>
> And then in the XML we could place modified parameters
>
> <programlisting start-id="main-routine" length="24">
> ...
> </programlisting>
>
>
> which would show the next 24 lines starting at the marker in the file.
> Or ..
>
>
> // <?db-code-start-id="main-routine"?>
> ... More code
> // <?db-code-end-id="main-routine-end"?>
>
>
> And then in the XML we could place modified parameters
>
> <programlisting start-id="main-routine" end-id="main-routine-end">
> ...
> </programlisting>
>
>
> Or is there something already in Docbook to do this?
>
> We have used Doxygen extensively, but the XML support is rather poor and
> right now does not have the power that the Docbook solution has.
>
>
> Dean Nelson
>
> -----Original Message-----
> From: Jay Bryant [mailto:jay@bryantcs.com]
> Sent: Sunday, October 15, 2006 10:56 AM
> To: Nelson, Dean; docbook-apps@lists.oasis-open.org
> Subject: Re: [docbook-apps] Programlisting of only part of a file
>
>
> Depending on what your source's content, you might be able to solve this
>
> with XSLT. If you can find (or create in some earlier processing)
> markers
> for the start and end points, you could easily pull just that bit with a
>
> simple transform (either by itself or as part of a larger process).
>
> HTH
>
> Jay Bryant
> Bryant Communication Services
>
> ----- Original Message -----
> From: "Nelson, Dean" <dean.nelson@eecradar.com>
> To: <docbook-apps@lists.oasis-open.org>
> Sent: Sunday, October 15, 2006 8:13 AM
> Subject: [docbook-apps] Programlisting of only part of a file
>
>
> All,
> I have looked for this answer. I think that I remember someone asking
> this
> but I cannot find it in the forum.
>
> How do I <programlisting> to show only part of a file? Assuming the file
> was
> 100 lines lond and I only want to show a snippet of code - 5 lines long
> starting at line 20.
>
> Cheers!
>
> Dean Nelson
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>


-- 
http://chris.chiasson.name/


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]