Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Wattsi is a build tool for creating the HTML Standard from its source. It works in concert with other scripts.



  • Number the sections
  • Create Table of Contents
  • Cross-reference <span> and <code> to <dfn>
  • Create small TOC
  • Cross-reference back (<dfn> menu)
  • Strip out unused references
  • Check for missing references
  • Spec splitting
  • Add output for <wpt> elements
  • Add MDN annotations
  • Add syntax-highlighting markup to <pre> contents

Wattsi syntax

For documentation on the "Wattsi language", e.g. things like data-x or w-nodev, see

Building and running Wattsi with Docker

The easiest way to use Wattsi is via Docker. Once you have Docker, you can download and run a copy of Wattsi from Docker Hub using

docker run whatwg/wattsi

The HTML build tools will automatically attempt to use this form if they cannot find a locally-installed copy of Wattsi.

If you're developing Wattsi, you can build and test it in Docker with the command make docker and docker run whatwg/wattsi. The latter accepts any Wattsi arguments, e.g. docker run whatwg/wattsi --version.

Building and running Wattsi manually

With the Free Pascal Compiler (fpc) installed, you should be able to run make manual to create the wattsi executable and supporting shared libraries.

The wattsi executable is at ./bin/wattsi. Tools such as html-build use $PATH to look for a local wattsi executable. In your terminal, run export PATH=$PATH:$(pwd)/bin. In the same terminal tab, you can now run tools that use the built wattsi executable.

For guidance on installing fpc, see the next section.

Installing the Free Pascal Compiler (fpc)

Wattsi is written in Free Pascal, so to build Wattsi, you'll need version 3.0.4 or later of the Free Pascal Compiler (fpc). You can get fpc by downloading a upstream release — but it’s recommended that you instead install fpc using a package manager.

Installing fpc on Debian and Ubuntu

On Debian and Ubuntu and any other Debian-derived systems, run apt install to install the necessary packages:

apt install fp-compiler fp-units-fcl fp-units-net libc6-dev

Installing fpc on macOS using Homebrew

On macOS, install Homebrew and the homebrew fpc 3.0.4 revision 1 (3.0.4_1) or later package. The revision 1 there is important — the initial 3.0.4 package will not work as expected on macOS Mojave (10.14) or later.

/bin/bash -c "$(curl -fsSL"
brew install fpc

Installing fpc on macOS from a upstream release

If you don’t want to use homebrew but instead prefer to install a upstream release, you must get fpc 3.0.4a or later. The “a” there is important — the initial 3.0.4 package will not work as expected on macOS Mojave (10.14) or later.

Installing XCode and the XCode command-line tools

On macOS, you may also need to have XCode and the latest XCode command-line tools installed.

If you already have XCode installed, you can ensure you have the latest XCode command-line tools by running the following command:

xcode-select --install


Preprocessor for the HTML Standard







No releases published


No packages published