Information for Help and Web Authors about this Site. - A4000026 - 15 Dec 2003

This document is intended for anyone who may be interested in any of the techniques used on this web site, and who would like to use them in their own pages. If you would like more information, please e-mail the author at awilliams@itim-ts.com

Topics covered include:

The DP4 Manual Pages and Help Menu

Software Used

Many of the DP4 Manual Pages were originally converted to HTML from Windows Help files. This was originally done using RoboHelp HTML Help edition, available from www.ehelp.com. However, they are currently maintained using Arachnophila version 4.0, available from www.arachnoid.com, which is free. The pages are built into downloadable manuals in Microsoft CHM format, using HTMLHelp Workshop, which is available as a free download from the Microsoft web site. This program allows you to visually edit table of contents and index files. However, it is rather buggy, and better programs are available for this purpose, for example FAR, which is available from www.helpware.net. (FAR also has many other uses, though in fact I do not use it at the moment). You need the HTMLHelp workshop to get the HTMLHelp compiler, even if you do not use the program to develop documentation, if you want to generate CHM files.

The help pages are available online using either the ActiveX HTMLHelp control, which only works in Internet Explorer, or using a Javascript Table of Contents. The former has an index facility, but its table of contents does not work well. I only provide it because it requires little or no work to maintain.

The Javascript menu is built using an adapted version of Morten's Tree Menu, available from www.treemenu.com. If you want to use a tree menu, I recommend visiting this site, as it contains extensive information on how to configure the menu. Utilities are also available for generating the table of contents. However, I do not know about these as I use my own utility, convhhc, to generate the table of contents from .hhc files.

Changes to Tree Menu for DP4 web site

My modifications to the tree menu are as follows:

You can download my version of mtmcode.js. The frameset for the manual pages uses code.html which I have renamed with .txt extension to allow you to inspect/download the source without opening the menu. The page displayed when the documentation frameset is first loaded sets the name of the table of contents to load. If you only have one table of contents to load then you can simplify code.html by just referring to the appropriate js file, rather than dynamically changing the name of the script. The Xlib documentation recently added to this size uses Xlibcode.html instead. The only difference is that most DP4 links are removed.

convhhc

convhhc is a utility that parses .hhc files and can emit various transformations of them. One of its most important features is that it recognises nested hhc files and can emit a merged version of the files. This allows different variants of the same table of contents to be maintained. For example the CHM tables of contents for most DP4 manuals include a "Related Documents" section, and some CHM manuals contain glossaries, or long lists of error messages, which would add considerably to the time needed to load the online table of contents, and have therefore been omitted. The CHM files often have two table of contents files built into them: one displayed when the file is opened in its own right; the other, missing "Related Documents", when it is displayed merged with another help file. This is done to stop the table of contents becoming recursive, (something that can crash the help viewer).

It should be noted that HTMLHelp workshop does not behave well with nested hhc files - in order to get the correct level of indentation at run time the file has to be formatted in a way that causes HTML workshop to malfunction, and corrupt the contents file. Fortunately, there is not usually much need to edit this files once they are created - only the component hhc files are usually changed. FAR's table of contents editor behaves correctly with such files.

convhhc outputs the following transformations of the file filename.hhc:

You can download convhhc.exe or convhhc.c. They are completely unwarranted. The make file I use to build all the DP4 CHM files and the Javascript contents is also available, which shows the various command tails to select the various types of output.


Stylesheets and Behaviors

The stylesheets used on the DP4 web site are intended to make pages work well without the need for extensive mark-up, at a wide variety of screen resolutions. In addition all sizes are specified in relative units, so that the pages behave well if the user selects a different font size in the printer. An entirely different stylesheet is used if a page is printed, intended to give a book-like appearance. To see what can be achieved with stylesheets visit the CSS Zen Garden. I have experimented with allowing the stylesheet to be changed on the DP4 web site, but this is not yet ready for release.

There are a few moderately unusual things about the style-sheets, mostly designed to exploit special features of Internet Explorer:

This is floating text, which can be used to put part of a page in a separate area. I prefer it to using tables because surrounding text can flow round it. It uses the xpanel class in my stylesheet.

Pages other than DP4 manual pages use site.css as a stylesheet.
Manual pages uses dp4man.css.
The behavior for the headings is 3dheads.htc.

Internet Explorer and Standards Compliance Mode

All pages,apart from framesets, on the DP4 web site now start with the following !DOCTYPE declaration:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

This was originally done to allow all the pages to be validated. However it had an unexpected (to me) side effect: the font size of all text on the site suddenly became smaller when viewed with Internet Explorer 6! The font sizes are chosen to render well at the default resolution of most web browsers. Unfortunately Internet Explorer often uses a much larger default size than other web browsers, and as a result most people would want to use the "Smaller" font size to view the DP4 web site. I felt this was better than rendering the page much too small for users of other browsers. Microsoft have realised the error of their ways, and have changed their default font sizes, however the change only comes into effect for pages that use "Standards Compliant Mode". It turns out that the above !DOCTYPE declaration turns this mode on.

I strongly recommend using one of the DOCTYPE declarations that enforce this mode, because CSS errors which Internet Explorer would otherwise silently ignore, and which would cause problems for other stricter browsers are more likely to become apparent. See CSS Enhancements in Internet Explorer 6 on MSDN for further information.

If you have attempted to size content to fit the browser window exactly, turning on Standards Compliance Mode may cause problems. This is usually related to the use of height:100% as a style or height="100%" on a table or div ( or any other percentage height for that matter). To make this work properly the whole document must be sized. Here is one way to do this using a stylesheet:

html,body
{
  height:100%;
}

Javascript Tips and Examples

Internet Explorer 6 Oddments

I recently converted my personal web site, originally created primarily for Internet Explorer 5, to work with IE6 in standards compliance mode. In the course of doing this I discovered some strange things: