Recent

Author Topic: creating a help file for my program  (Read 6585 times)

hy

  • Full Member
  • ***
  • Posts: 213
creating a help file for my program
« on: March 26, 2015, 09:22:28 pm »
Hi, I have been searching around but without any results.
How do I create a help file for my program that is called by pressing <CTRL-F1> as a contextual help.

I have the data in rtf-files and chm files but the chm files have been created with window formerly.
Never did that with lazarus/linux at all. Thanks in advance.
_____
***hy
OS: debian sid(64bit)  [fpc 3.0.4] Lazarus SVN

howardpc

  • Hero Member
  • *****
  • Posts: 3039
Re: creating a help file for my program
« Reply #1 on: March 27, 2015, 12:42:31 am »

hy

  • Full Member
  • ***
  • Posts: 213
Re: creating a help file for my program
« Reply #2 on: March 27, 2015, 01:12:11 pm »
thanks howardpc: I have searched for keywords "create" and "help" which led to thousands of irrelevant results.
"Add help" would have been the key.
_____
***hy
OS: debian sid(64bit)  [fpc 3.0.4] Lazarus SVN

hy

  • Full Member
  • ***
  • Posts: 213
Re: creating a help file for my program
« Reply #3 on: March 29, 2015, 01:51:16 pm »
Well, still I am having some trouble.
I created the chm-files
The project File for the chm looks like

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<CONFIG>
  <Files>
    <Count Value="112"/>
    <FileName0 Value="html/about.htm" ContextName="about" ContextNumber="20"/>
    <FileName1 Value="html/Alt_Z.htm" ContextName="Undo" ContextNumber="50"/>
   ... >100 items following
   [...]
Running the chm-file standalone
Code: [Select]
lhelp ychmfile.chmI can find all topics

Problem 1:
If I am operating my program and open the about-box I am getting: "Help context 20 not found." after pressing F1

Problem 2:
The htmlfiles contain images (as in <img src="image,gif") but the images are missing in the chm (I can tell that also from the size of the chm-file).
I have tried to put the images in seperate folders and into the same folder as the html-files - but that didn't change anything.
any help apreciated
« Last Edit: March 29, 2015, 02:28:04 pm by hy »
_____
***hy
OS: debian sid(64bit)  [fpc 3.0.4] Lazarus SVN

hy

  • Full Member
  • ***
  • Posts: 213
Re: creating a help file for my program
« Reply #4 on: April 01, 2015, 06:07:18 pm »
push - sorry for pushing this question but I don't have any solution up to now...
_____
***hy
OS: debian sid(64bit)  [fpc 3.0.4] Lazarus SVN

timppl

  • Jr. Member
  • **
  • Posts: 70
Re: creating a help file for my program
« Reply #5 on: April 02, 2015, 07:40:26 am »
I also had the same problem in that I could not get the context help to work at all. In the end I created help files as html and put a HTMLBrowserHelpViewer in the application and used keyword help. Then you can use code like
Code: [Select]
      ShowHelpOrErrorForKeyword( '', 'html/index.html');

to show the help in a browser.
To improve the finding of help topics you can use something like
Code: [Select]
  ShowHelpOrErrorForKeyword (  '','html/' + 'manual.html' + '#'+ 'drawing.plan.keyboard.shortcut' );

and in your html have a ref like
Code: [Select]
<a id=
"drawing.plan.keyboard.shortcut">

and you should find it works fine.
Mageia 2 Linux on x86

hy

  • Full Member
  • ***
  • Posts: 213
Re: creating a help file for my program
« Reply #6 on: April 02, 2015, 11:01:10 am »
Thanks timppl, but actually (from a users' point of view) I don't like html help files.
Well, if not other solution is to be found I will be trying your solution.
_____
***hy
OS: debian sid(64bit)  [fpc 3.0.4] Lazarus SVN

Graeme

  • Hero Member
  • *****
  • Posts: 1430
    • Graeme on the web
Re: creating a help file for my program
« Reply #7 on: April 08, 2015, 06:31:29 pm »
Attached is a fully working example of an LCL application using fpGUI's DocView help viewer. It shows context sensitive help and general help. The docview application needs to be in your PATH environment, but a small tweak to the code supplied and it can look for DocView in the same path as the application executable (maybe that would be preferred).

For example:
  • Set the focus to a specific control and press F1. It will show the help topic for that specific control.
  • Click the Help button and it will show the help topic for the dialog/form.
  • Select the "Help -> Show Help" menu item and it will show the general application help and display the first topic in the help file.

You can change the help file location to any relative or absolute directory location. For example:

Code: Pascal  [Select]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   Application.HelpFile := 'help/helptest.inf';
  4.   { or even }
  5.   //Application.HelpFile := '/usr/local/share/myapp/helptest.inf';
  6.   ...snip...
  7. end;
  8.  

The help file is a INF help file which is included in fpGUI's repository in the tools/wipfc/ directory. Binaries of the IPF Compiler are supplied for Linux and Windows in the zip and tar.gz archives in that directory.  Help is authored using IPF (Information Presentation Facility) format which can be used for application help and eBook documents. IPF is very easy to learn tagging language. It is much less verbose than HTML and the tags are mnemonic, making it easy to associate them with their functions. INF files are also magnitudes smaller and faster that CHM.

Pre-built binaries of Docview (the help viewer) can be downloaded from fpGUI's SourceForge page:
  http://sourceforge.net/projects/fpgui/files/fpGUI/1.4/

Included in the fpGUI repository is an extensive document explaining the IPF syntax with lots of examples. See the <fpgui>/docview/docs/IPFREF_v4.INF file - viewable with DocView of course.

Hope this helps.

Screenshots of DocView
  http://fpgui.sourceforge.net/screenshots_apps.shtml

See Also:
Docview integration into various IDE's.
  http://fpgui.sourceforge.net/docview_ide_integration.shtml
« Last Edit: November 08, 2016, 03:39:24 pm by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/