Hi Robin,
Patrick K. O'Brien wrote:
Kevin Ollivier <kevino@tulane.edu> writes:
DocBook is the closest thing I can think of to what you're looking
for here, in that it does have some HTML, PDF, etc. conversion tools
available and has some specific tags for software and API
documentation.
Using DocBook would be killing the fly with a sledgehammer. Better
watch your fingers! 
I agree. Although if the tools took the simpler xml structure that I'll be able to generate from SWIG's xml and converted it to a subset of DocBook that might be okay.
Better yet, look at reST or epydoc.
http://epydoc.sourceforge.net/
Twisted uses epydoc conventions for documenting types and other
parameter requirements in docstrings. I think epydoc is as close to a
Python standard as one will find. And Twisted is one heck of a big
framework. So we would be in good company.
Pat, I have a few goals for the reference docs, some of which I alluded to earlier in #3, maybe you could think about these and see if there is a good fit based on what you know about reST and epydoc.
1. I want the text content to be easy to edit and read as plain text with inline markup that doesn't get in the way. This obviously leads to something like reST or epy.
2. For various reasons I don't want the reference docs to be generated by scanning the real modules in the real wx package. Firstly because then we would have to put way too much text in some of the docstrings, or scrimp and not put enough because they are docstrings too. Secondly tools that I've seen for that will document *everything* and the docs end up bloated with nodes for things like wxNO_BORDER, or wxWindowPtr with no text about it, and things like that are better docuemtned with the class or method where they are supposed to be used anyway. I'm sure there are ways to avoid having the tools do that, but then we (I) would have to maintain or generate yet another list of things...
3. I think that the intermediate XML doc with all the data for the class/method docs is important, but we end up with lots of little snippets of reST or epytext that need to be combined in some way that leads to a coherent set of reference docs with an intuitive organizational structure, cross-links and such. Are any of the existing tools able to handle a situation such as this?
Interestingly enough, EClass might help here. It's basically a content management app geared towards documentation, or using the education-friendly buzzword, "learning modules". It lets you take a bunch of files (not necessarily HTML), organize them into sections/subsections, and (if you want) add some metadata. Then it creates an HTML version of the files, and also generates a table of contents in HTML that works much like a treeview, + - buttons and all. The end product can be viewed by any major web browser. It works with frames/non-frames and you could even create your own "Theme" (look and feel) for the wxPython documentation.
For an example (non-technical, it's a course on culture differences), see:
http://www3.uop.edu/sis/culture/index.htm?page=/sis/culture/
And before you ask, yes you can widen that table of contents. Why they chose to make it that small I don't know. =)
The interesting thing is that you aren't required to use HTML as an input format. There's a plugin API so that one can write a plugin to convert, say, .py files, to HTML, and then the plugin just tells EClass the "whatever.html" filename of the converted file so that it can generate appropriate links and such. And thanks to the plugin api, you can mix and match files of any format in your documentation. For example, you could add both .py files (containing automated docstrings) and also plain HTML docs (getting started, tutorial, examples) into your documentation seamlessly. You don't have to 'pick' a format that the entire documentation needs to be written in. In the end, they all blend together as HTML-based documentation for the user. You could even input LaTeX docs from wxWindows so long as you developed an EClass plugin to convert it to HTML (which could simply call tex2rtf or whatever). BTW, the structure of the documentation is stored as a separate XML file, which is how all this becomes possible. Oh, and EClass also creates a full-text index using SWISH-E, so the entire documentation is searchable. =)
PDF docs could be created using a HTML->PDF conversion tool, and same with HTML Help. OpenOffice and PyUNO could probably be used to make RTF/DOC/SXW format docs if we wanted to do that too. =)
EClass lacks documentation as I have been working on many of these features over the past year, but I'm now gearing up for a final 2.5 release and am currently developing documentation for it both at the end user and at the developer level. (i.e. architecture, plugin API) I plan on having the documentation ready within the next week or two. I'm also updating the web site to make it more helpful and less boring. =) Of course I am using EClass for all this, so you will be able to see how it works. Once I have the documentation ready, I am planning to post an announcement on wxPython-users anyways as I thought it might be a useful tool for some folks. =)
Just some thoughts. There is one last trivial benefit - it gives us the bragging rights to say we use a wxPython application to maintain the wxPython documentation.
If anyone wants to play with the software, I can send out a link to the latest and greatest Windows version, or otherwise you can wait till I finish the docs and make the announcement on wxPython-users. =)
Thanks,
Kevin
···
On Nov 14, 2003, at 12:40 PM, Robin Dunn wrote:
I suppose one approach is to take the XML and generate a fake python wx package with just the items that we want documented and then use that with the existing tools, but that sounds icky. The approach I was orginally thinking of is that as part of the process of building that XML it will convert each of the little snippets of content text into reST's XML format (it does have one doesn't it?) and then making that structured XML be a part of the overall structure, in addition to the unconverted raw text. Finally, converting the whole thing to whatever format is wanted on the back end really shouldn't be all that hard.
Thoughts?