You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47-22
Original file line number
Diff line number
Diff line change
@@ -2,34 +2,39 @@
2
2
3
3
This repository contains the tools and instructions necessary for building the [HTML Standard](https://html.spec.whatwg.org/multipage/) from its [source](https://github.com/whatwg/html).
4
4
5
-
## Prerequisites
5
+
## Getting set up
6
6
7
-
Before building, make sure you have the following commands installed on your system.
7
+
Make sure you have `git`installed on your system, and you are using a Bash shell. (On Windows, `cmd.exe` will not work, but the Git Bash shell that comes with [Git for Windows](https://git-for-windows.github.io/) works nicely.)
8
8
9
-
-`curl`, `git`, `grep`, `perl`, `unzip`
9
+
Then, clone this ([html-build](https://github.com/whatwg/html-build)) repo:
10
10
11
-
Optionally, for faster builds, you can install [Wattsi](https://github.com/whatwg/wattsi) on your system. If you don't bother with that, the build will use [Wattsi Server](https://github.com/domenic/wattsi-server).
11
+
```
12
+
git clone https://github.com/whatwg/html-build.git && cd html-build
13
+
```
14
+
15
+
You then have a decision to make as to how you want to do your builds: locally, on your computer, or using a [Docker](https://www.docker.com/) container. We suggest going the Docker route if and only if you are already comfortable with Docker.
12
16
13
-
## Build
17
+
## Building locally
14
18
15
-
Building your own copy of the HTML Standard from its source requires just these simple steps:
19
+
### Prerequisites
16
20
17
-
1. If you want to submit a pull request to the [whatwg/html](https://github.com/whatwg/html) repo, fork it and clone your fork. (If not, you can skip this step.)
18
-
```
19
-
git clone https://github.com/<username>/html.git
20
-
```
21
+
To build locally, you'll need the following commands installed on your system:
21
22
22
-
1. Clone this ([html-build](https://github.com/whatwg/html-build)) repo:
23
-
```
24
-
git clone https://github.com/whatwg/html-build.git && cd html-build
25
-
```
23
+
-`curl`, `grep`, `perl`, `unzip`
26
24
27
-
1. Run the `build.sh` script from inside your `html-build` working directory, like this:
28
-
```
29
-
./build.sh
30
-
```
25
+
Optionally, for faster builds, you can install [Wattsi](https://github.com/whatwg/wattsi). If you don't bother with that, the build will use [Wattsi Server](https://github.com/domenic/wattsi-server), which requires an internet connection.
31
26
32
-
## Output
27
+
### Running the build
28
+
29
+
Run the `build.sh` script from inside your `html-build` working directory, like this:
30
+
31
+
```
32
+
./build.sh
33
+
```
34
+
35
+
The first time this runs, it will ask for your input on where to clone the HTML source from, or where on your system to find it if you've already done that. If you're working to submit a pull request to [whatwg/html](https://github.com/whatwg/html), be sure to give it the URL of your fork.
36
+
37
+
### Output
33
38
34
39
After you complete the build steps above, the build will run and generate the single-page version of the spec, the multipage version, and more. If all goes well, you should very soon have all the following in your `output/` directory:
35
40
@@ -42,16 +47,36 @@ After you complete the build steps above, the build will run and generate the si
42
47
-`link-fixup.js`
43
48
-`multipage/*`
44
49
45
-
And then you're also ready to edit the `html/source` file—and after you make your changes, you can run the `build.sh` script again to see the new output.
50
+
Now you're ready to edit the `html/source` file—and after you make your changes, you can run the `build.sh` script again to see the new output.
51
+
52
+
## Building using a Docker container
53
+
54
+
The Dockerized version of the build allows you to run the build entirely inside a "container" (lightweight virtual machine). This includes tricky dependencies like a local copy of Wattsi, as well as the Apache HTTP server with a setup analogous to that of https://html.spec.whatwg.org.
46
55
47
-
## Options
56
+
To perform a Dockerized build, use the `--docker` flag:
57
+
58
+
```
59
+
./build.sh --docker
60
+
```
61
+
62
+
The first time you do this, Docker will download a bunch of stuff to set up the container properly, but subsequent runs will simply build the standard and be very fast.
63
+
64
+
After building the standard, this will launch a HTTP server that allows you to view the result at `http://localhost:8080`. (OS X and Windows users will need to use the IP address of their docker-machine VM instead of `localhost`. You can get this with the `docker-machine env` command.)
65
+
66
+
Note that due to the way Docker works, the HTML source repository must be contained in a subdirectory of the `html-build` working directory. This will happen automatically if you let `build.sh` clone for you, but if you have a preexisting clone you'll need to move it.
67
+
68
+
## A note on Git history
69
+
70
+
Your clone doesn't need the HTML standard's complete revision history just for you to build the spec and contribute patches. So, if you use `build.sh` to create the clone, we don't start you out with a clone of the history. That makes your first build finish much faster. And if later you decide you do want to clone the complete history, you can still get it, by doing this:
48
71
49
-
Your clone doesn't need the HTML standard's complete revision history just for you to build the spec and contribute patches. So, by default we don't start you out with a clone of the history. That makes your first build finish much faster. And if later you decide you do want to clone the complete history, you can still get it, by doing this:
50
72
```
51
73
cd ./html && git fetch --unshallow
52
74
```
75
+
53
76
That said, if you really do want to *start out* with the complete history of the repo, then run the build script for the first time like this:
77
+
54
78
```
55
79
HTML_GIT_CLONE_OPTIONS="" ./build.sh
56
80
```
81
+
57
82
That will clone the complete history for you. But be warned: It'll make your first build take *dramatically* longer to finish!
0 commit comments