An overview of the html module's role and abilities.


§1. Prerequisites. The html module is a part of the Inform compiler toolset. It is presented as a literate program or "web". Before diving in:

§2. Purpose. Many functions of the Inform toolset involve the generation of HTML in some way, but almost all of that work is actually done by the foundation module. If you're interested in how HTML pages are made, how tags are opened and closed, and such, see HTML (in foundation) and Epub Ebooks (in foundation). All of that code is general-purpose.

By contrast, the html module is very much a part of the Inform compiler and provides highly Inform-specific functions needed to make the intranet-like miniature websites it generates on the fly — problem pages, the Index, the extensions documentation. In particular, it offers:

§3. Custom HTML link protocols. This seems a useful place to document something which the Inform GUI apps must provide. These render index, problem and extension mini-website pages in embedded web browser views: for example, Inform on MacOS is essentially running a copy of Safari (or rather, its underlying engine WebKit) under the hood to display these. The material displayed consists of standard web pages, except that there are two custom "transport protocols" or "URL schemas".

Protocols like this go under a number of names, partly because there are many subtly different ideas here which only experts can distinguish (see https://en.wikipedia.org/wiki/Application_layer for the entrance to the rabbit-hole). To us, anyway, protocols are the prefixes of URLs which end with a colon — all browsers recognise a standard set of these, of which http: https: and file: are by far the most commonly used.

Inform uses two non-standard ones in these internal pages, and so the GUI app must implement them for its embedded web engine:

§4. The reason inform: is needed is that HTML files generated by Inform have no way to know the relative URLs necessary to access e.g. icon images for the World index, which will be in different places in the file system on different Inform apps. More formally, the specification of inform: is that —

§5. Localisation. This module also contains a very simple system for "localisation" of text, that is, enabling the user to output text in multiple human languages. (Inform makes heavy use of this in the Index.) This may not appear at first to have anything to do with HTML, but in fact we will mainly use it when generating web pages in the Index, so it has some conveniences for stylistic markup as well.

See Localisation for details.