It is currently Tue Jul 23, 2019 12:55 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Cross-platform HTML Help module
PostPosted: Sun Dec 30, 2018 12:51 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Dec 17, 2009 12:00 pm
Posts: 175
Location: Llangadog, Wales, UK
Here is my take on a cross-platform HTML help file viewer. It's only a viewer module - not to create the help files. There's been some recent discussion on this subject so this is just what works for me. Though most of the code is a few years old, I didn't post before because I assumed (maybe wrongly?) that people would already have a good solution.

The module, called HelpViewX, takes the same approach as the help for the PureBasic IDE on the Mac. I think the PB Help is great on all platforms and I wanted to attempt something similar for my application on the Mac. Also over the last year I've been using it for Linux. I don't use it for Windows as I'm currently happy with .chm and the native PureBasic OpenHelp, but the module does work the same on Windows.

Main code calls the help with OpenHelpX(dirpath) - intentionally quite similar to the native PureBasic so it's easy to switch between platforms. It uses two XML files to show the Contents and Index. The module code is simple and not too big. The XML stuff is virtually lifted from the PureBasic example - nothing fancy.

The zip file contains 'helpviewx.pbi' and a 'helpexample' directory with a small complete help system for test and demonstration. The module code can be compiled on its own, with a requester to select the directory, either helpexample or your own. The example help gives a bit more info about the module.

Should work on Windows, Mac and Linux (gtk2, gtk3 and qt) - runs on my systems but don't blame me if it falls over in a smelly heap or needs tweaking to suit your set-up!

http://www.deeproot.co.uk/downloads/HelpViewX.zip

_________________
www.deeproot.co.uk


Top
 Profile  
Reply with quote  
 Post subject: Re: Cross-platform HTML Help module
PostPosted: Sun Dec 30, 2018 4:48 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 24, 2012 10:19 am
Posts: 107
Infortually, html files are not displayed with Windows XP 32b, PB5.70b4 32b.

M.


Top
 Profile  
Reply with quote  
 Post subject: Re: Cross-platform HTML Help module
PostPosted: Sun Dec 30, 2018 6:11 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Dec 17, 2009 12:00 pm
Posts: 175
Location: Llangadog, Wales, UK
Mesa wrote:
Infortually, html files are not displayed with Windows XP 32b, PB5.70b4 32b.
@Mesa
Works fine here - Windows XP Professional SP3 32-bit, Purebasic 5.70 B4 X86.

Does the WebGadget work OK on your system? The files themselves will also open in a browser - FF, IE and Opera all display them on XP.

_________________
www.deeproot.co.uk


Top
 Profile  
Reply with quote  
 Post subject: Re: Cross-platform HTML Help module
PostPosted: Sun Dec 30, 2018 6:27 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 24, 2012 10:19 am
Posts: 107
Everything is ok, with FF, or the webgadget.
So, i don't know, maybe the path ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Cross-platform HTML Help module
PostPosted: Sun Dec 30, 2018 9:06 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Dec 17, 2009 12:00 pm
Posts: 175
Location: Llangadog, Wales, UK
Hmm - strange!
Can't reproduce it here - tried different locations and drive partitions to alter path but works as it should. Will try a different Win XP machine tomorrow.

_________________
www.deeproot.co.uk


Top
 Profile  
Reply with quote  
 Post subject: Re: Cross-platform HTML Help module
PostPosted: Sun Dec 30, 2018 9:35 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Nov 25, 2013 6:41 am
Posts: 763
Checked on Mac OS works great.
And how to create this help?


Top
 Profile  
Reply with quote  
 Post subject: Re: Cross-platform HTML Help module
PostPosted: Mon Dec 31, 2018 12:27 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue May 26, 2009 2:11 pm
Posts: 583
Mesa wrote:
Everything is ok, with FF, or the webgadget.
So, i don't know, maybe the path ?

It's the URLEncoder() who makes the program not working.
(At least here)

Called link is "file://D:/Eigene Dateien/PureBasic/HelpViewX/helpexample/introduction.html"
after URLEncoder(): "file://D:/Eigene%20Dateien/PureBasic/HelpViewX/helpexample/introduction.html"

Space in folder name is replaced by "%20". And that is what the WebGadget doesn't like.

Eliminating all URLEncoder() works for me here with Win7x64 and PB5.70LTSbeta3(x64).

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Cross-platform HTML Help module
PostPosted: Mon Dec 31, 2018 3:45 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Dec 17, 2009 12:00 pm
Posts: 175
Location: Llangadog, Wales, UK
Lord wrote:
Space in folder name is replaced by "%20". And that is what the WebGadget doesn't like.

Eliminating all URLEncoder() works for me here with Win7x64 and PB5.70LTSbeta3(x64).
Thanks Lord - I also suspected something to do with URLEncoder - more testing today and I can now reproduce the problem and confirm your finding.

URLEncoder was added a long time ago due to the opposite problem on the Mac (my main use of the module). Paths with spaces prevented display of files in WebGadget - they needed to be replaced with %20. Also some other characters were not valid.

Using URLEncoder fixed the problem on MacOS, but it appears WebGadget on Windows does not like it :?

WebGadget on Linux appears to work both with and without URLEncoder (on my distro at least!).

Module source has been changed to omit URLEncoder for Windows only - Zip file is replaced, same link as top post.

_________________
www.deeproot.co.uk


Top
 Profile  
Reply with quote  
 Post subject: Re: Cross-platform HTML Help module
PostPosted: Tue Jan 01, 2019 2:23 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Dec 17, 2009 12:00 pm
Posts: 175
Location: Llangadog, Wales, UK
mestnyi wrote:
Checked on Mac OS works great.
And how to create this help?
Personally I make my help files manually, using any convenient text editor. I thought about writing tools to assist with this but never had the time. Also I don't write new help files very often, so it's not a big deal for me. Maintaining an existing help system, even a big one, is not much trouble.

All files are just text so there are lots of possibilities on all platforms - Notepad++, TextWrangler and many others. Even the Purebasic IDE is good for a quick edit! For more fancy html layout you could try a WYSIWYG method such as BlueGriffon. However, I think the best advice is to keep the help pages as simple as possible. There is also not much to the two XML files - just repetitive statements.

During development of an application it makes sense to progressively add the help pages as you go, so it doesn't become a huge task at the end. If it helps then feel free to use my example files as templates.

_________________
www.deeproot.co.uk


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye