Skip to content

Commit fa76c71

Browse files
committed
Merge branch 'main' of https://github.com/WebAssembly/spec
2 parents 7f3a876 + e87021b commit fa76c71

File tree

242 files changed

+37289
-7653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+37289
-7653
lines changed

.github/workflows/main.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
jobs:
13+
ref-interpreter:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Setup OCaml
18+
uses: ocaml/setup-ocaml@v2
19+
with:
20+
ocaml-compiler: 4.12.x
21+
- run: opam install --yes ocamlbuild.0.14.0
22+
- run: cd interpreter && opam exec make all
23+
24+
build-js-api-spec:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- run: pip install bikeshed && bikeshed update
29+
- run: bikeshed spec "document/js-api/index.bs" "document/js-api/index.html"
30+
- uses: actions/upload-artifact@v2
31+
with:
32+
name: js-api-rendered
33+
path: document/js-api/index.html
34+
35+
build-web-api-spec:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v2
39+
- run: pip install bikeshed && bikeshed update
40+
- run: bikeshed spec "document/web-api/index.bs" "document/web-api/index.html"
41+
- uses: actions/upload-artifact@v2
42+
with:
43+
name: web-api-rendered
44+
path: document/web-api/index.html
45+
46+
build-core-spec:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v2
50+
with:
51+
submodules: "recursive"
52+
- run: pip install bikeshed && bikeshed update
53+
- run: pip install six
54+
- run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
55+
- run: pip install sphinx==4.0.0
56+
- run: cd document/core && make all
57+
- uses: actions/upload-artifact@v2
58+
with:
59+
name: core-api-rendered
60+
path: document/core/_build/html
61+
62+
publish-spec:
63+
runs-on: ubuntu-latest
64+
needs: [build-core-spec, build-js-api-spec, build-web-api-spec]
65+
steps:
66+
- uses: actions/checkout@v2
67+
- run: mkdir _output && cp document/index.html _output/index.html
68+
- uses: actions/download-artifact@v2
69+
with:
70+
name: js-api-rendered
71+
path: _output/js-api
72+
- uses: actions/download-artifact@v2
73+
with:
74+
name: web-api-rendered
75+
path: _output/web-api
76+
- uses: actions/download-artifact@v2
77+
with:
78+
name: core-api-rendered
79+
path: _output/core
80+
- name: Publish HTML to GitHub Pages
81+
if: github.ref == 'refs/heads/main'
82+
uses: peaceiris/actions-gh-pages@v3
83+
with:
84+
publish_dir: ./_output
85+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/mirror.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
on:
2+
push:
3+
branches:
4+
- 'main'
5+
6+
jobs:
7+
mirror_job:
8+
runs-on: ubuntu-latest
9+
name: Mirror main branch to master branch
10+
steps:
11+
- name: Mirror action step
12+
id: mirror
13+
uses: google/mirror-branch-action@v1.0
14+
with:
15+
github-token: ${{ secrets.GITHUB_TOKEN }}
16+
source: 'main'
17+
dest: 'master'

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

Contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Interested in participating? Please follow
44
[the same contributing guidelines as the design repository][].
55

6-
[the same contributing guidelines as the design repository]: https://github.com/WebAssembly/design/blob/master/Contributing.md
6+
[the same contributing guidelines as the design repository]: https://github.com/WebAssembly/design/blob/main/Contributing.md
77

88
Also, please be sure to read [the README.md](README.md) for this repository.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/WebAssembly/multi-value.svg?branch=master)](https://travis-ci.org/WebAssembly/annotations)
1+
![Build Status](https://github.com/WebAssembly/annotations/actions/workflows/main.yml/badge.svg)
22

33
# Custom Annotations Proposal for WebAssembly
44

@@ -30,3 +30,7 @@ should take place in
3030
[the WebAssembly design repository](https://github.com/WebAssembly/design)
3131
first, so that this spec repository can remain focused. And please follow the
3232
[guidelines for contributing](Contributing.md).
33+
34+
# citing
35+
36+
For citing WebAssembly in LaTeX, use [this bibtex file](wasm-specs.bib).

deploy_key.enc

-3.17 KB
Binary file not shown.

document/README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,98 @@ To build everything and update [webassembly.github.io/spec](https://webassembly.
2121
make publish
2222
```
2323
Please make sure to only use that once a change has approval.
24+
25+
## Step by step guide to building the spec
26+
27+
### Prerequisites
28+
29+
You will need `python3.7`, and `pip`. `pip` should come with Python, if not follow [these installation instructions for `pip`](https://pip.pypa.io/en/stable/installing/), or check your system package manager for `pip3`.
30+
31+
> Important: you will need the version of pip that works with `python3.7`.
32+
33+
34+
Use something like [`pipenv`](https://pipenv.pypa.io/) to keep your system installation of Python clean.
35+
36+
```
37+
pip install pipenv
38+
pipenv --python 3.7
39+
pipenv shell
40+
```
41+
42+
Install Python dependencies:
43+
44+
```
45+
pipenv install Sphinx==4.0.0
46+
```
47+
48+
### Checking out the repository
49+
50+
Make sure this repository was cloned with `--recursive`:
51+
52+
```
53+
git clone --recursive https://github.com/WebAssembly/spec
54+
```
55+
56+
If you have already cloned but without `--recursive`, you can delete and re-clone, or `cd` into `spec` and run:
57+
58+
```
59+
git submodule update --init --recursive
60+
```
61+
62+
The rest of these instructions assume you are in the directory where is README is:
63+
64+
```
65+
cd spec/document
66+
```
67+
68+
### Building the multi-page HTML document
69+
70+
You can now build the [multi-page html document](https://webassembly.github.io/spec/core/):
71+
72+
```
73+
make -C core html
74+
```
75+
76+
### Building the single-page HTML document
77+
78+
To build the [single-page W3C version](https://webassembly.github.io/spec/core/bikeshed/), there are more dependencies to install. First, get [Bikeshed](https://github.com/tabatkins/bikeshed):
79+
80+
```
81+
# cd back to root of git directory
82+
git clone https://github.com/tabatkins/bikeshed.git
83+
pipenv install -e bikeshed
84+
bikeshed update
85+
```
86+
87+
You will also need `npm` and `yarn` for all the LaTeX goodness. `npm` might already be available on your system, you can also use something like [`nvm`](https://github.com/nvm-sh/nvm) to prevent messing with system packages:
88+
89+
```
90+
npm install -g yarn
91+
cd document
92+
make -C core bikeshed
93+
```
94+
95+
### Building the PDF
96+
97+
To build the [PDF](https://webassembly.github.io/spec/core/_download/WebAssembly.pdf), you will need `texlive-full`, install it using your system package manager:
98+
99+
```
100+
apt install texlive-full
101+
make -C core pdf
102+
```
103+
104+
### Building the JavaScript Embedding API
105+
106+
To build the [JavaScript Embedding API](https://webassembly.github.io/spec/js-api/index.html), you will need `bikeshed` as describe in the section [Building the single-page HTML document](#building-the-single-page-html-document):
107+
108+
```
109+
make -C js-api
110+
```
111+
112+
### Building the Web Embedding API
113+
114+
To build the [Web Embedding API](https://webassembly.github.io/spec/web-api/index.html), you will need `bikeshed` as describe in the section [Building the single-page HTML document](#building-the-single-page-html-document):
115+
116+
```
117+
make -C web-api
118+
```

document/core/Makefile

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@ STATICDIR = _static
1010
DOWNLOADDIR = _download
1111
NAME = WebAssembly
1212

13-
# Hack until we have moved to more recent Sphinx.
14-
OLDMATHJAX = https://cdn.mathjax.org/mathjax/latest/MathJax.js
15-
NEWMATHJAX = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js
16-
1713
# Internal variables.
1814
PAPEROPT_a4 = -D latex_paper_size=a4
1915
PAPEROPT_letter = -D latex_paper_size=letter
20-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
16+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
2117
# the i18n builder cannot share the environment and doctrees with the others
2218
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
2319

@@ -93,8 +89,12 @@ bikeshed-keep:
9389
echo Downloaded Bikeshed.
9490

9591

92+
.PHONY: index
93+
index:
94+
(cd appendix; ./gen-index-instructions.py)
95+
9696
.PHONY: pdf
97-
pdf: latexpdf
97+
pdf: index latexpdf
9898
mkdir -p $(BUILDDIR)/html/$(DOWNLOADDIR)
9999
ln -f $(BUILDDIR)/latex/$(NAME).pdf $(BUILDDIR)/html/$(DOWNLOADDIR)/$(NAME).pdf
100100

@@ -105,22 +105,16 @@ clean:
105105
rm -rf $(STATICDIR)
106106

107107
.PHONY: html
108-
html:
108+
html: index
109109
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
110110
for file in `ls $(BUILDDIR)/html/*.html`; \
111111
do \
112112
sed s:BASEDIR:.:g <$$file >$$file.out; \
113113
mv -f $$file.out $$file; \
114-
sed s~$(OLDMATHJAX)~$(NEWMATHJAX)~g <$$file >$$file.out; \
115-
mv -f $$file.out $$file; \
116114
done
117115
for file in `ls $(BUILDDIR)/html/*/*.html`; \
118116
do \
119117
sed s:BASEDIR:..:g <$$file >$$file.out; \
120-
sed 's;<body; <script type="text/javascript">MathJax.Hub.Config({TeX: {MAXBUFFER: 30*1024}})</script><body;' \
121-
<$$file.out >$$file; \
122-
rm -f $$file.out; \
123-
sed s~$(OLDMATHJAX)~$(NEWMATHJAX)~g <$$file >$$file.out; \
124118
mv -f $$file.out $$file; \
125119
done
126120
@echo
@@ -147,7 +141,7 @@ bikeshed:
147141
mkdir -p $(BUILDDIR)/bikeshed_mathjax/
148142
bikeshed spec index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
149143
mkdir -p $(BUILDDIR)/html/bikeshed/
150-
(cd util/katex/ && npm install --only=prod)
144+
(cd util/katex/ && yarn && yarn build && npm install --only=prod)
151145
python util/mathjax2katex.py $(BUILDDIR)/bikeshed_mathjax/index.html \
152146
>$(BUILDDIR)/html/bikeshed/index.html
153147
mkdir -p $(BUILDDIR)/html/bikeshed/katex/dist/
@@ -268,7 +262,7 @@ latex:
268262
latexpdf:
269263
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
270264
@echo "Running LaTeX files through pdflatex..."
271-
$(MAKE) -C $(BUILDDIR)/latex all-pdf
265+
$(MAKE) -C $(BUILDDIR)/latex LATEXMKOPTS=" </dev/null" all-pdf >$(BUILDDIR)/latex/LOG 2>&1 || cat $(BUILDDIR)/latex/LOG
272266
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
273267

274268
.PHONY: latexpdfja

0 commit comments

Comments
 (0)