Skip to content

Commit 8086956

Browse files
committed
Add draft of the specification of validation
1 parent 006b97c commit 8086956

25 files changed

+5455
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/

LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ to that directory and its relative sub-directories.
44
The relevant directories and licenses are:
55

66
design/ - Apache License 2.0
7+
spec/document/ - W3C Software and Document Notice and License
78

89
(Other directories will be added when the [module-linking] repository merges.)
910

spec/document/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_build/
2+
util/__pycache__

spec/document/LICENSE

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE
2+
3+
This work is being provided by the copyright holders under the following
4+
license.
5+
6+
7+
LICENSE
8+
9+
By obtaining and/or copying this work, you (the licensee) agree that you have
10+
read, understood, and will comply with the following terms and conditions.
11+
12+
Permission to copy, modify, and distribute this work, with or without
13+
modification, for any purpose and without fee or royalty is hereby granted,
14+
provided that you include the following on ALL copies of the work or portions
15+
thereof, including modifications:
16+
17+
* The full text of this NOTICE in a location viewable to users of the
18+
redistributed or derivative work.
19+
20+
* Any pre-existing intellectual property disclaimers, notices, or terms and
21+
conditions. If none exist, the W3C Software and Document Short Notice
22+
(https://www.w3.org/Consortium/Legal/copyright-software-short-notice) should
23+
be included.
24+
25+
* Notice of any changes or modifications, through a copyright statement on the
26+
new code or document such as "This software or document includes material
27+
copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)."
28+
29+
30+
DISCLAIMERS
31+
32+
THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS
33+
OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF
34+
MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE
35+
SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
36+
TRADEMARKS OR OTHER RIGHTS.
37+
38+
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
39+
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT.
40+
41+
The name and trademarks of copyright holders may NOT be used in advertising or
42+
publicity pertaining to the work without specific, written prior permission.
43+
Title to copyright in this work will at all times remain with copyright
44+
holders.
45+
46+
47+
NOTES
48+
49+
This version:
50+
http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document

spec/document/Makefile

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?= -d _build/.doctrees
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
SOURCE_DATE_EPOCH = $(shell date +"%s")
12+
13+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
14+
15+
# Put it first so that "make" without argument is like "make help".
16+
help:
17+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
18+
19+
.PHONY: help Makefile
20+
21+
# Catch-all target: route all unknown targets to Sphinx using the new
22+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
23+
%: Makefile
24+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
25+
26+
.PHONY: html
27+
html:
28+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
29+
for file in `ls $(BUILDDIR)/html/*.html`; \
30+
do \
31+
sed s:BASEDIR:.:g <$$file >$$file.out; \
32+
mv -f $$file.out $$file; \
33+
done
34+
for file in `ls $(BUILDDIR)/html/*/*.html`; \
35+
do \
36+
sed s:BASEDIR:..:g <$$file >$$file.out; \
37+
mv -f $$file.out $$file; \
38+
done
39+
@echo
40+
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html/."
41+
42+
NAME=webassemblycomponentmodel
43+
44+
.PHONY: docs
45+
docs: html latexpdf
46+
mkdir -p ../../docs/multihtml/
47+
cp -r $(BUILDDIR)/html/* ../../docs/multihtml/
48+
rm ../../docs/multihtml/objects.inv
49+
mkdir -p ../../docs/_download/
50+
cp $(BUILDDIR)/latex/$(NAME).pdf ../../docs/_download/

spec/document/appendix/index.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. _appendix:
2+
3+
Appendix
4+
========

spec/document/binary/index.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _binary:
2+
3+
Binary Format
4+
=============
5+
6+
TODO: Formal write-up of the binary format.

spec/document/conf.py

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
from datetime import date
16+
sys.path.insert(0, os.path.abspath('.'))
17+
18+
19+
# -- Project information -----------------------------------------------------
20+
21+
name = 'WebAssembly Component Model'
22+
project = 'WebAssembly Component Model'
23+
title = 'WebAssembly Component Model Specification'
24+
copyright = '2022 WebAssembly Community Group'
25+
author = 'Authors of the Webassembly Component Model Specification'
26+
27+
version = u'0.0'
28+
# The draft version string (clear out for release cuts)
29+
draft = ' (Draft ' + date.today().strftime("%Y-%m-%d") + ')'
30+
# The full version, including alpha/beta/rc tags.
31+
release = version + draft
32+
33+
mathjax_path='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
34+
35+
# -- General configuration ---------------------------------------------------
36+
37+
# Add any Sphinx extension module names here, as strings. They can be
38+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39+
# ones.
40+
extensions = [
41+
'sphinx.ext.mathjax',
42+
'util.mathdef'
43+
]
44+
45+
# Add any paths that contain templates here, relative to this directory.
46+
templates_path = ['_templates']
47+
48+
# List of patterns, relative to source directory, that match files and
49+
# directories to ignore when looking for source files.
50+
# This pattern also affects html_static_path and html_extra_path.
51+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
52+
53+
54+
# -- Options for HTML output -------------------------------------------------
55+
56+
# The theme to use for HTML and HTML Help pages. See the documentation for
57+
# a list of builtin themes.
58+
#
59+
html_theme = 'alabaster'
60+
html_theme_options = {
61+
'description': 'WebAssembly Component Model Specification',
62+
'fixed_sidebar': True,
63+
'sidebar_width': '260px',
64+
'sidebar_collapse': True,
65+
'show_powered_by': False,
66+
'extra_nav_links': {
67+
'Index': 'BASEDIR/genindex.html',
68+
'Download as PDF': 'BASEDIR/../_download/webassemblycomponentmodel.pdf'
69+
},
70+
}
71+
html_title = project +u' ' + release
72+
html_copy_source = False # At least for the one included in docs/ ...
73+
74+
# Add any paths that contain custom static files (such as style sheets) here,
75+
# relative to this directory. They are copied after the builtin static files,
76+
# so a file named "default.css" will overwrite the builtin "default.css".
77+
# html_static_path = ['_static']
78+
79+
pwd = os.path.abspath('.')
80+
rst_prolog = """
81+
.. include:: /""" + pwd + """/util/macros-core.def
82+
.. include:: /""" + pwd + """/util/macros.def
83+
"""

spec/document/exec/index.rst

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _exec:
2+
3+
Execution
4+
=========
5+
6+
TODO: Describe the execution semantics of a component
7+
8+
.. toctree::
9+
:maxdepth: 2

spec/document/index.rst

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.. wasm components documentation master file, created by
2+
sphinx-quickstart on Wed Sep 22 14:51:32 2021.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to the WebAssembly Component Model Specification
7+
========================================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
intro/index
14+
syntax/index
15+
valid/index
16+
exec/index
17+
binary/index
18+
text/index
19+
appendix/index
20+
21+
Indices and tables
22+
==================
23+
24+
* :ref:`genindex`
25+
* :ref:`modindex`
26+
* :ref:`search`

spec/document/intro/index.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _intro:
2+
3+
Introduction
4+
============
5+
6+
TODO: Introduction

spec/document/shell.nix

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{ nixpkgs ? import <nixpkgs> {} }: with nixpkgs;
2+
stdenv.mkDerivation {
3+
name = "wasm-components-spec";
4+
buildInputs = [ gnumake sphinx texlive.combined.scheme-full ];
5+
}

0 commit comments

Comments
 (0)