Fork me on GitHub
CyberShadow's D resources:     

Valid XHTML 1.0 Strict Valid CSS!

D CHM generator

Compiled HTML Help for the D programming language

In an attempt to ease the life of 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 .chm format was initially created by Microsoft as a next-generation help file format instead of the dating Windows Help (.hlp) format. It was introduced in Windows 98, and is still currently supported. Since then, many 3rd-party applications for various operating systems have been developed to support the format. (more information)

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 many assumptions on how the help files are laid out, so it will probably work with future D releases. The only exception is that the program uses Kirk McDonald's keyword index, 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.

Build instructions

To generate your own CHM from the D HTML files:

  1. download and install the Microsoft HTML Help Workshop
  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 !

Pre-compiled CHMs

Alternatively, you can download precompiled CHM files. Don't expect these to be always up-to-date with the latest D versions, though.

CHM for D 1.076

CHM for D 2.061

Usage instructions

To read the CHM file, you need some kind of CHM viewer. The Microsoft CHM reader (usually located in C:\Windows\hh.exe) comes included with every Windows version since Windows 98. For non-Windows operating systems, there are many free and open-source CHM readers on the web.


If you see a "Navigation to the webpage was canceled" error page instead of the HTML content, you have to uncheck the "Always ask before opening this file" checkbox on the "Open File - Security Warning" dialog. Alternatively, click the "Unblock" button on the file's "Properties" dialog.

Version history


Things that could still be improved:


I release the source code (chmgen.d) to the Public Domain (no rights reserved). However, the contents of the included wiki page is distributed under FDL.