CHM (HTML Help) creator for D documentation

Vladimir Panteleev thecybershadow at gmail.com
Sun Mar 25 13:09:16 PDT 2007


Greetings,

In an attempt to ease the life of Windows D programmers, I decided to write an utility which would automatically convert the D documentation, distributed with DMD, to an HTML Help project. It was an interesting task, and through some effort I managed at automating the creation of an usable 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 the program uses Kirk McDonald's keyword index ( http://www.prowiki.org/wiki4d/wiki.cgi?LanguageSpecification/KeywordIndex ), since I didn't find a reliable way to find where respective keywords are explained in the documentation. 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 following modifications:

1) remove the left navigation bar (it is replaced by the HTML Help's navigation 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://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en
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://thecybershadow.net/d/docs/d.chm
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 immediately.

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 allow 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). However, the contents of the included wiki page is distributed under FDL.

-- 
Best regards,
  Vladimir                          mailto:thecybershadow at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chmgen.d
Type: text/x-dsrc
Size: 25303 bytes
Desc: not available
Url : http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20070325/1d3bfd80/attachment.d 


More information about the Digitalmars-d-announce mailing list