Joakim Nygård Archive Linked About

The Jargon File on MacOS X

6 May 2022

Around 17 years ago when MacOS X ‘Tiger’ was introduced and included the Dictionary application, I had the idea to compile the Jargon File in a compatible format (the Jargon File is a glossary of computer related slang). Unfortunately nothing came of it. Revisiting old files and blog posts made me look at the idea again.

The Jargon File is maintained in XML Docbook format and the format Apple uses for the dictionaries on MacOS is also an XML specification, so XSL transformation should be a reasonable way. The specification is included with the “Additional Tools for Xcode” download from Apple’s Developer pages (requires account). Rather than setting up the entire Docbook toolchain, I opted for xsltproc to handle the XSL transformation. Unfortunately the parser complains about undefined entities in the jargon source and it does not seem possible to define them without altering the original xml.

<!ENTITY % xhtml-lat1
    PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
            "xhtml-lat1.ent" >

<!ENTITY % xhtml-special
    PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
            "xhtml-special.ent" >

<!ENTITY % xhtml-symbol
    PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
            "xhtml-symbol.ent" >

After further reading of both specs and experimenting with the samples included in the Dictionary Development Kit downloaded from Apple, I managed to get a reasonable part of the glossary converted:

xsltproc -o appleformat.xml transformation.xsl jargon.xml

Combining the resulting xml file with a stylesheet and the various images included, the dictionary can be built from the Makefile provided with the dictionary devkit.

To install, download the Jargon File for MacOS X, move the dictionary to the ~/Library/Dictionaries/ folder, then open Dictionary and activate the dictionary from the Preferences. The project files are also available on GitHub. Feels good to complete an old geeky idea.