www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - CHM (HTML Help) creator for D documentation


In an attempt to ease the life of Windows D programmers, I decided to wr=
ite an utility which would automatically convert the D documentation, di=
stributed with DMD, to an HTML Help project. It was an interesting task,=
 and through some effort I managed at automating the creation of an usab=
le CHM file.

The advantages of using a CHM help file over the included HTML files:

1) it's one compressed file, instead of many
2) the contents is somewhat easier to navigate
3) it has instantaneous indexed search, supporting boolean operators
4) comprehensive index of literally too many keywords...

The program doesn't make assumptions on how the help files are laid out,=
 so it should work with future D releases. The only exception is that th=
e program uses Kirk McDonald's keyword index ( http://www.prowiki.org/wi=
ki4d/wiki.cgi?LanguageSpecification/KeywordIndex ), since I didn't find =
a reliable way to find where respective keywords are explained in the do=
cumentation. The full unmodified source of that wiki page is embedded in=
 the program source, so it should be just as easy to update.

When preparing the help files for the CHM format, the program does the f=
ollowing modifications:

1) remove the left navigation bar (it is replaced by the HTML Help's nav=
igation pane)
2) skip Google AdSense ads, which don't make any sense in offline media =
- browsers don't (and shouldn't) allow uploading contents of local data =
to web services, thus Google AdSense displays rubbish/Chinese ads anyway=

Here's the usage instructions:

1) download and install the Microsoft HTML Help Workshop from here: http=
2) save chmgen.d to ...\dmd\html\
3) compile and run it
4) open the d.hhp file with HTML Help Workshop and compile it
    -- or --
    run: hhc.exe d.hhp
5) enjoy your brand new d.chm !

Alternatively, you can download the CHM file from here: http://thecybers=
I am not sure about the distribution rights of the documentation, so if =
there are some legal problems, let me know and I'll remove it immediatel=

Things that could still be improved:

  - inserting anchors in some places, like before every function in the =
Phobos docs
  - a cleaner/more accurate index
  - splitting the articles in categories (D syntax, Phobos, ...) to allo=
w filtering
  - adding Tango docs for an all-in-one D help file?
  - the code could be generally cleaned up in some places...

I release the attached code to the Public Domain (no rights reserved). H=
owever, the contents of the included wiki page is distributed under FDL.=

-- =

Best regards,
  Vladimir                          mailto:thecybershadow gmail.com
Mar 25 2007