2

We want to make documentation for some new components in Lazarus. Chm documentation files are already available, and we just need to somehow integrate them with Lazarus.

This help system should be context-sensitive, that is after F1 key was pressed on an element (function, property, etc) of the defined components, the respective help in the chm file is appeared in Lhelp (Lazarus help program).

So, what should we do to provide such a context-sensitive help please?

Thanks in advance

Masood
  • 685
  • 2
  • 8
  • 16
  • I'm not sure if Lazarus accepts thirdparty chms atm. But you could check how the current ones are loaded and parsed. – Marco van de Voort Oct 29 '15 at 16:30
  • Here in this [example](https://github.com/alrieckert/lazarus/blob/master/components/chmhelp/democontrol/ctxchmhelpunit1.pas), a chm file is integrated to a form and run by pressing F1 focusing on a Text Edit (comments in the beginning of the pascal file explain). I tried and it works. But it is an example on a form, defines values for properties (HelpType and HelpKeyword) in TEdit, and there are two components added to the form (TCHMHelpDatabase and TLHelpConnector). My purpose is defining helps on new components; that is, pressing F1 on an element (function, property, etc) shows lhelp. – Masood Oct 30 '15 at 10:16
  • @Masood: As I understand you don't want application help (context-sensitive) but F1 help from a selected word (e.g. property) in the Lazarus IDE's code Editor for a integrated component? – help-info.de Oct 30 '15 at 13:45
  • @help-info.de: yes, that's true. We want to have context-sensitive help on source code editor, when one is using our component. – Masood Nov 02 '15 at 13:33

2 Answers2

0

You can use fpdoc top create the documentation, and compile it to chm, and lazarus/lhelp should open all CHMs in the document/ directory according to http://bugs.freepascal.org/view.php?id=15334

The index part of the CHM is iirc used for the lookup.

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
0

There's a similar question posted here: How do I add a .chm help file to my application built in Lazarus?

There's a wiki page about it in the Lazarus/FreePascal wiki: http://wiki.lazarus.freepascal.org/Add_Help_to_Your_Application

As far as my knowledge Lazarus provides help files as HTML files by default, anyway CHM files are supported too.

There's a sample program in your Lazarus installation:

${lazarusdir}/components/chmhelp/democontrol/.

This demo shows how to set up a context- sensitive help button (F1 usually).

Be sure to check the documentation about lhelp, the default Lazarus CHM viewer too, described here:

http://wiki.lazarus.freepascal.org/lhelp

Community
  • 1
  • 1
  • Please don't add the same answer to multiple questions. Answer the best one and flag the rest as duplicates. See http://meta.stackexchange.com/questions/104227/is-it-acceptable-to-add-a-duplicate-answer-to-several-questions – Bhargav Rao Oct 13 '16 at 13:31