I am looking to add a help system to a wxpython application and have
looked at the html_help.py file in the
.../samples/wxPIA_book/Chapter-16
directory. I have a couple of questions. What are the hhc and hhp
files? How do I generate an index? Otherwise, I guess my actual
content files could be HTML; is that correct?
I haven't used wxPIA, though I hear it's excellent, so my vocabulary may
be a bit different than Robin's.
The *.hpp file is a Project definition file. I use 4 of them (with the
AddBook method,) one for my Manual, one for my Tutorial, and a couple
others for specialized topics that don't fit into the manual or
tutorial. This gives me 4 sections or major headings in the Contents
menu in my Help screen. Here's the contents of my Manual.hpp file:
Contents file=Manual.hhc
Index file=Manual.hhk
Title=Transana Manual
Default topic=MainScreen.htm
You will see that the Manual.hpp file points to the Manual.hhc file,
which contains the Contents definitions for that section, all the tree
nodes that appear under the "Transana Manual" title under "Contents" on
my Help screen. It also points to Manual.hhk, which is the index file.
Entries in the Index file show up on the index tab in the Help screen.
The *.hhc and *.hhk files have the same syntax. What I do is create all
my sections in my *.hhc sections, then copy the file with an hhk
extension and add a few additional entries using alternate phrases
people might use to look up the contents sections. The file format of
*.hhc and *.hhk files is basically a list of objects. Here's one of my
section headings:
<li> <object type="text/sitemap">
<param name="Name" value="Video Window">
<param name="Local" value="VideoWindow.htm">
</object>
As you can see, this links the "Video Window" section heading / index
entry with the "videowindow.htm" file, which is just a standard HTML
file. (I *think* only a subset of HTML is really supported. Don't try
anything TOO fancy, like style sheets. But I set my system up several
years ago, and improvements may have been made since then, so YMMV.)
One thing I've noticed recently is that when my index file reached 100
index values, the index tab stopped automatically populating itself and
users now have to press the "Show all" button to get the index tab
populated. I find this most unfortunate, but lack the skills to alter
the necessary bit of the wxWidgets code to change this.
Hope that makes things a bit clearer. If you want to see an example of
the HtmlHelpController in action, and get all the files that make it
work, go to http://www.transana.org and download my Demo version.
Installing the demo will install my full help system, and you can look
in the Demo's "help" directory to see the files that the help system
uses. You can also find my SourceForge link on the Transana web site if
you want to see how I link to the Help infrastructure.
David