Wattsi is a build tool for creating the HTML Standard from its source. It works in concert with other scripts.
Currently:
- 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
For documentation on the "Wattsi language", e.g. things like data-x
or w-nodev
, see Syntax.md.
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
.
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.
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 freepascal.org upstream release — but it’s recommended that you instead install fpc using a package manager.
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
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.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install fpc
If you don’t want to use homebrew but instead prefer to install a freepascal.org 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.
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