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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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


Subject: DOCBOOK: C++ to docbook filter?


Is there a filter around anywhere that will convert C++ into docbook?

The main thing I want to do is take a C++ source file, and stick a standard 
header and footer on the file, and save it into an sgm file, and build a file that 
cross-references all these files.

This must be a frequently asked question.

It should be sufficient to convert this foo.cpp into something stuffed into a 
CDATA section:

void foo()
{
	for ( long i = 0; i < 10; i++ ){	// note there's a reserved character
		abort();
	}
}

into file foo.sgm:

<programlisting>
<filename>foo.c</filename>
<[CDATA[
void foo()
{
	for ( long i = 0; i < 10; i++ ){	// note there's a reserved character
		abort();
	}
}
]]>
</programlisting>

I could probably write the above in Perl if no one has anything available but 
my Perl is pretty rusty.  If I do though I'll post the tool on my web page.

What would be _really_ sexy is a tool that would actually parse the C++ 
source and make cross-references, so that is the resulting docbook were 
converted into HTML, clicking on a class name would take you to its class 
declaration, and clicking on a method declaration inside a class declaration 
would take you to its implementation, and clicking on a method name 
anywhere else would give you a list of all the classes that have that method - 
so you'd be able to implement a class browser in HTML.

The reason I want this is that I'm just sitting down to start documenting an 
extensive class library a friend of mine has spent five years writing.  Part of 
the deal of me getting to use his library is that I will write the documentation 
for it before he puts it into open source (more about that later - it's pretty 
spiffy stuff).

He suggested I write the doc in DocBook, and although I see there is a lot to 
learn I have to agree.  It seems that I can express most of what I need to say 
in the beginning with just a few elements.  But one thing I'd really like to have 
is browsing of the source code on the web page where we're going to put the 
source distribution.

Best,

Mike Crawford

Michael D. Crawford
GoingWare, Inc. - Expert Software Development and Consulting
http://www.goingware.com
crawford@goingware.com

     Tilting at Windmills for a Better Tomorrow


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


Powered by eList eXpress LLC