I am trying to use the HTML help controller in one of my projects (wxPython latest Phoenix running under Mint 20.3) and I am having difficulties figuring out what sort of input help file types the ctor accepts.
Currently, it seem it will accept a *.hhp file, but the only way I know of creating one of those is to decompile an existing *.CHM file.
My code looks like:
def InitHelp(self):
self.help = wx.html.HtmlHelpController()
#helpFile = "/home/arnold/Public/pkg/python/wxPython/wpSkAui/wpSkAuiHelp/htb/wpSkAuiHelp.zip"
helpFile = "/home/arnold/Public/pkg/python/wxPython/wpSkAui/wpSkAuiHelp/htb/wxSkAuiHelp.hhp"
self.m_textCtrlLog.AppendText( helpFile + "\n" )
if os.path.exists(str(helpFile)):
try:
self.help.AddBook( helpFile )
except:
print( "Error")
self.m_textCtrlLog.AppendText( "Exception: Could not load :" + helpFile + "\n" )
else:
print( "File does not exist:" + helpFile )
self.m_textCtrlLog.AppendText( "File: " + helpFile + " does not exist\n" )
The documentation says:
AddBook<big>(</big>*book* <big>)</big>
Adds new book.
book is URL (not filename!) of HTML help project (hhp) or ZIP file that contains arbitrary number of .hhp projects (this zip file can have either .zip or .htb extension, htb stands for “html book”).
Returns success.
**Parameters:**
* book (string)
**Returns:**
bool
Evidently the code does not implement what the documentation says -
I have tried to use a newly generated HTB file with the appropriate content, either directly or renamed to have a zip extension.
Either case displays a bare & empty help dialog.
If I do use a HHP file from a decompiled CHM file, the help dialog will display the contents of the old CHM.
Any help, comments or suggestions will be much appreciated
Arnold