Difference between revisions of "Installing Help in the IDE"

From Free Pascal wiki
Jump to navigationJump to search
m (Added section on packaged Lazarus; typos, grammar; removed superfluous reasons for installing kylix help.)
Line 2: Line 2:
  
 
=Installing CHM Help for The RTL, FCL and LCL in the Lazarus IDE=
 
=Installing CHM Help for The RTL, FCL and LCL in the Lazarus IDE=
 +
 +
==If you are using Lazarus from a package/installer==
 +
The installer or package may have already set up help for you. If this is not the case, please follow the instructions under the "installing from subversion" section.
  
 
==If you are using Lazarus from Subversion==
 
==If you are using Lazarus from Subversion==
  
The Lazarus help files can be installed following this easy steps:
+
The Lazarus help files can be installed following these easy steps:
 
+
<ol>
1) Make sure that the package '''chmhelppkg''' is intalled. See the menu Package->Install Packages. This package is installed by default in the "bigide" so most users should already have it installed.
+
<li>Make sure that the package '''chmhelppkg''' is intalled. See the menu Package->Install Packages. This package is installed by default in the "bigide" so most users should already have it installed.</li>
 
+
<li>Open the project lazarus/components/chmhelp/lhelp/lhelp.lpi</li>
2) Open the project lazarus/components/chmhelp/lhelp/lhelp.lpi
+
<li>Build this project</li>
 
+
<li>Download the latest stable Lazarus CHM help files from http://sourceforge.net/projects/lazarus/files/Lazarus%20Documentation/</li>
3) Build this project
+
<li>Copy all CHM files to lazarus/docs/html</li>
 
+
<li>Go to the Environment Options, tab "Help Options' and select the "CHM Help Viewer". Check its properties:
4) Download the latest stable Lazarus CHM help files from http://sourceforge.net/projects/lazarus/files/Lazarus%20Documentation/
+
:"HelpExe" should be the lhelp you just built
 
+
:"HelpFilesPath" should be, where you put the CHM files</li>
5) Copy all CHM files to lazarus/docs/html
+
</ol>
 
+
Now context sensitive help using F1 should work.
6) Go to the Environment Options, tab "Help Options' and select the "CHM Help Viewer". Check it's properties:
 
:"HelpExe" should be the lhelp you did just build
 
:"HelpFilesPath" should be, where you did put the chm files
 
 
 
Now context sensitive help using F1 should already be working.
 
  
 
=Installing INF Help in the IDE=
 
=Installing INF Help in the IDE=
Line 28: Line 26:
  
 
=Installing the Kylix Help in the Lazarus IDE=
 
=Installing the Kylix Help in the Lazarus IDE=
 +
 +
This section will show you how to use the Kylix 3 context sensitive help system with a Linux installation of Lazarus.
  
 
==The files needed from Kylix3==
 
==The files needed from Kylix3==
  
When I finally gave up on Borland and switched to Lazarus, I was dismayed to find that the familiar help system was missing.  I have gotten use to just typing in a function / keyword, then hitting {{keypress|Ctrl|F1}} to bring up the help to see what the parameters were to be.  This will show you how to use the Kylix context sensitive help system with a Linux installation of Lazarus.
+
Since many of you have been coding in Kylix, you probably already have these files lying around some place. I suspect that the help system from the free version of Kylix may work as well. These are the files and directories needed from the ''${HOME}/kylix/help'' directory:<br>
 
 
Since many of you have been coding in Kylix, you probably already have these files lying around some place. I suspect that the help system from the free version of Kylix may work as well under this outline? These are the files and directories needed from the ''${HOME}/kylix/help'' directory:<br>
 
 
<tt><code><br>
 
<tt><code><br>
 
  bin/          k3clx.hlp    k3dbd.cnt    k3.hlp
 
  bin/          k3clx.hlp    k3dbd.cnt    k3.hlp
Line 64: Line 62:
  
 
==The hyperhelp.sh script==
 
==The hyperhelp.sh script==
We do need to dress up the default help script provided with Kylix so that it will work as a standalone app under X.  Note that the last line of the script sets some missing rendering parameters? Also note the -geometry which positions the window and sets its size.
+
We do need to dress up the default help script provided with Kylix so that it will work as a standalone app under X.  Note that the last line of the script sets some missing rendering parameters. Also note the -geometry which positions the window and sets its size.
  
<tt><code>
+
<bash>
<br>
 
 
  #!/bin/bash
 
  #!/bin/bash
 
  HHHOME="${HOME}/Lazarus/DelphiHelp"
 
  HHHOME="${HOME}/Lazarus/DelphiHelp"
Line 81: Line 78:
 
  bin/hyperhelp k3clx.hlp -m AL\($1,3,,main\)\
 
  bin/hyperhelp k3clx.hlp -m AL\($1,3,,main\)\
 
     -s 0 -d 32159 -display :0.0 -geometry 600x500+100+100 -w
 
     -s 0 -d 32159 -display :0.0 -geometry 600x500+100+100 -w
<br>
+
</bash>
</code></tt>
 
  
==my Directory tree==
+
==My directory tree==
 
This is where I have placed the Kylix Help file directory.  It is under my installation of Lazarus in the user home directory.  The hyperhelp.sh script refers to these locations.
 
This is where I have placed the Kylix Help file directory.  It is under my installation of Lazarus in the user home directory.  The hyperhelp.sh script refers to these locations.
  
Line 100: Line 96:
  
 
==Custom Tool setup in IDE==
 
==Custom Tool setup in IDE==
Finally, setup the new custom tool within Lazarus from then menu 'Tools|Configure custom tools|Add'.  Replace '/home/tom/' with your user home directory path.  This has to be an absolute path to the hyperhelp.sh script.
+
Finally, set up the new custom tool within Lazarus from the menu 'Tools|Configure custom tools|Add'.  Replace '/home/tom/' with your user home directory path.  This has to be an absolute path to the hyperhelp.sh script.
  
 
[[Image:edittool.png]]
 
[[Image:edittool.png]]
Line 110: Line 106:
  
 
The fpdoc entries for the FPC sources can be downloaded from svn:
 
The fpdoc entries for the FPC sources can be downloaded from svn:
 
+
<bash>
 
  cd /home/username/yourchoice/
 
  cd /home/username/yourchoice/
 
  svn co http://svn.freepascal.org/svn/fpcdocs/trunk fpcdocs
 
  svn co http://svn.freepascal.org/svn/fpcdocs/trunk fpcdocs
 +
</bash>
  
 
Add the path ''/home/username/yourchoice/fpcdocs'' to Tools / Options / Environment / FPDoc Editor
 
Add the path ''/home/username/yourchoice/fpcdocs'' to Tools / Options / Environment / FPDoc Editor

Revision as of 12:53, 16 February 2012

Template:Adding Kylix Help

Installing CHM Help for The RTL, FCL and LCL in the Lazarus IDE

If you are using Lazarus from a package/installer

The installer or package may have already set up help for you. If this is not the case, please follow the instructions under the "installing from subversion" section.

If you are using Lazarus from Subversion

The Lazarus help files can be installed following these easy steps:

  1. Make sure that the package chmhelppkg is intalled. See the menu Package->Install Packages. This package is installed by default in the "bigide" so most users should already have it installed.
  2. Open the project lazarus/components/chmhelp/lhelp/lhelp.lpi
  3. Build this project
  4. Download the latest stable Lazarus CHM help files from http://sourceforge.net/projects/lazarus/files/Lazarus%20Documentation/
  5. Copy all CHM files to lazarus/docs/html
  6. Go to the Environment Options, tab "Help Options' and select the "CHM Help Viewer". Check its properties:
    "HelpExe" should be the lhelp you just built
    "HelpFilesPath" should be, where you put the CHM files

Now context sensitive help using F1 should work.

Installing INF Help in the IDE

See http://fpgui.sourceforge.net/docview_ide_integration.shtml

Installing the Kylix Help in the Lazarus IDE

This section will show you how to use the Kylix 3 context sensitive help system with a Linux installation of Lazarus.

The files needed from Kylix3

Since many of you have been coding in Kylix, you probably already have these files lying around some place. I suspect that the help system from the free version of Kylix may work as well. These are the files and directories needed from the ${HOME}/kylix/help directory:

bin/           k3clx.hlp     k3dbd.cnt    k3.hlp
foo            k3.cnt        k3dbd.fts    k3indy.cnt
foo~           k3copts.cnt   k3dbd.hlp    k3indy.fts
hhintro.txt    k3copts.fts   k3dbx.cnt    k3indy.hlp
hoh.cnt        k3copts.hlp   k3dbx.fts    k3iota.cnt
hoh.fts        k3crtl.cnt    k3dbx.hlp    k3iota.fts
hoh.hlp        k3crtl.fts    k3derrs.cnt  k3iota.hlp
hyperhelp.sh*  k3crtl.hlp    k3derrs.fts  k3new.cnt
k3.als         k3ctools.cnt  k3derrs.hlp  k3new.fts
k3cerrs.cnt    k3ctools.fts  k3dlr.cnt    k3new.hlp
k3cerrs.fts    k3ctools.hlp  k3dlr.fts    k3prog.cnt
k3cerrs.hlp    k3cw.cnt      k3dlr.hlp    k3prog.fts
k3clr.cnt      k3cw.fts      k3dopts.cnt  k3prog.hlp
k3clr.fts      k3cw.hlp      k3dopts.fts  lib/
k3clr.hlp      k3dap.cnt     k3dopts.hlp
k3clx.cnt      k3dap.fts     k3.ftg
k3clx.fts      k3dap.hlp     k3.fts



Most of the above files may not pertain to Lazarus, such as the k3c* files which relate to C++, but they are harmless to keep around.

The bare minimum files needed for the context help are these:

bin/           k3.als     k3clx.fts  k3.cnt  k3.fts  lib/
hyperhelp.sh*  k3clx.cnt  k3clx.hlp  k3.ftg  k3.hlp


The hyperhelp.sh script

We do need to dress up the default help script provided with Kylix so that it will work as a standalone app under X. Note that the last line of the script sets some missing rendering parameters. Also note the -geometry which positions the window and sets its size.

<bash>

#!/bin/bash
HHHOME="${HOME}/Lazarus/DelphiHelp"
XPPATH="${HHHOME}/xprinter"
LANG=en_US
LC_ALL=en_US
locale=${LC_ALL:-${LC_CTYPE:-${LANG:-"C"}}}
LD_LIBRARY_PATH+="lib/locale/"${locale}":lib:"
XAPPLRESDIR="app-defaults"
NLSPATH="lib/locale/%L/%N.cat"
export XPPATH HHHOME LANG LC_ALL LD_LIBRARY_PATH XAPPLRESDIR NLSPATH
cd $HHHOME
bin/hyperhelp k3clx.hlp -m AL\($1,3,,main\)\
    -s 0 -d 32159 -display :0.0 -geometry 600x500+100+100 -w

</bash>

My directory tree

This is where I have placed the Kylix Help file directory. It is under my installation of Lazarus in the user home directory. The hyperhelp.sh script refers to these locations.

/home/tom/Lazarus/DelphiHelp/
|-- bin
`-- lib
   `-- locale
       |-- de_DE
       |-- fr_FR
       |-- ja_JP.SJIS
       |-- ja_JP.eucJP
       `-- ja_JP.eucjp

Custom Tool setup in IDE

Finally, set up the new custom tool within Lazarus from the menu 'Tools|Configure custom tools|Add'. Replace '/home/tom/' with your user home directory path. This has to be an absolute path to the hyperhelp.sh script.

edittool.png

In summary

Just place your cursor in the edit window on the word you want to find help for and press Ctrl+F1. The Kylix help will then open up the context sensitive help page for that keyword.

fpdoc entries of RTL and FCL

The fpdoc entries for the FPC sources can be downloaded from svn: <bash>

cd /home/username/yourchoice/
svn co http://svn.freepascal.org/svn/fpcdocs/trunk fpcdocs

</bash>

Add the path /home/username/yourchoice/fpcdocs to Tools / Options / Environment / FPDoc Editor

The source editor hints should now show help for TComponent.Name.