File: readmechm.txt

package info (click to toggle)
fpc 3.2.0%2Bdfsg-12
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 338,552 kB
  • sloc: pascal: 3,794,737; xml: 191,997; ansic: 9,637; asm: 8,482; java: 5,346; sh: 4,664; yacc: 3,751; makefile: 2,688; lex: 2,538; javascript: 2,375; sql: 929; php: 473; cpp: 145; perl: 134; sed: 132; csh: 34; tcl: 7
file content (101 lines) | stat: -rw-r--r-- 4,186 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
CHM helpfiles.
=============

CHM support based on the great work of Andrew is now also available in the 
textmode IDE.  This archive also contains the .xct and .kwd files that are
needed for crosslinking this archive with other CHM files. These files are
not required for viewing (but are only about 1% of the total size)

toc.chm is a workaround for help systems that don't provide a list of 
helpfiles. In such system it provides access to the default pages of the 
various CHMs.

How to install the CHMs in Lazarus
------------------------------------

- Install the chmhelp package
- Copy the chm, xct, or kwd files to docs/chm in the Lazarus directory.

Note that Lazarus does not load ref.* at this moment, so (CHM) help
on keywords does not work yet.
Note that toc.chm is not loaded by the LHelp CHM viewer at the present time.

How to install the CHMs into the textmode IDE.
-------------------------------------

1. extract the archive somewhere, the archive already has an "help/" path
    built in. (on windows/dos: c:\fpc, under unix e.g. /usr/share/fpc/help)
2. add the files to the textmode IDE using the "help->files->new" button.
	Add toc.chm first, then add the other files in random order.
3. it is safe to restart the IDE before testing. (in case something goes
   wrong at least your help config will be saved)

The helpconfiguration is stored, with paths in fp.ini, and might look like
this:

[Help]
Files="/fpc/fpcdocs/toc.chm;/fpc/fpcdocs/fcl.chm;/fpc/fpcdocs/ref.chm;/fpc/fpcdocs/rtl.chm;/fpc/fpcdocs/prog.chm;/fpc/fpcdocs/user.chm;/fpc/fpcdocs/fclres.chm"

Troubleshooting
--------------

If you use Windows XPsp2 or later, and an helpfile won't view, go into the
file explorer, and bring up the properties of the CHM file. Then click
"unblock" there. Apparantly, in some cases Windows thinks the helpfiles are
downloaded content, and prevents access.

To do this programatically, FPC 2.4.3+ has this functionality built into the
chmls utility (chmls unblock <chmfile>)

What is CHM? 
------------

CHM is an archive format specially made for HTML based help by Microsoft. It
is also known as HTMLHELP, but note that HTMLHELP2 (and in the future 3) are
not related.  Besides being an archive format optimized to quickly extract a
single file, there is also a TOC, an Index and fulltext search dictionaries
in each CHM. 

The html in a CHM is basically unmodified except for links from one chm file
to the other, these use a ms-its://file.chm/path/to/htmlfile.html like URL
syntax. Some extra tables with references might be generated.

The format is sometimes related to security problems, but as far as I have
been able to verify, this is more an Internet Explorer viewer application
problem, not a problem of the format itself

What OSes support CHM natively?
----------------------

Windows versions after windows 98 can open CHMs. Due to new security
measures in XPsp2 and later, sometimes unlocking the CHMs is necessary (see
troubleshooting paragraph).

On Linux (and mostly *nix in general) there are at least four packages
to process CHMs in addition to FPC/Lazarus' own:

- the xCHM viewer
- the KCHMViewer viewer
- the GNOCHM viewer
- the chmlib packages (sometimes called extract_chmlib) that allows to unpack
     chm files.

Older kchmviewers (<=4.0) are known to have a problem with the indexes of
the larger chm files (rtl.chm, and lcl.chm from Lazarus), and only show the
first couple of hundred entries.  The author has been notified and can't
reproduce it with his latest builds anymore.

kchmviewer versions (even as new as in Fedora 13) seem to have problems with
links that don't have a leading / either ( ? ). I reported it to kchmviewer,
but the maintainer said it was a problem of QT (and indeed, switching
khtmlpart resolves it)

Gnochm is extremely slow with the larger files, and development seems to
have stalled.

xCHM in the recent version seems to work fine and reasonably fast. (lcl.chm
in a few secs).  However its TOC system is not a tree, and some versions
won't load some nodes (same problem as kchmviewer ?). The most recent
version seems to have fixed it.

Of course the lazarus and FPC textmode IDE now also support CHM.