Skip to content

Commit

Permalink
Add draft of the specification of validation
Browse files Browse the repository at this point in the history
  • Loading branch information
pl-semiotics committed Jan 10, 2023
1 parent 006b97c commit 9a40737
Show file tree
Hide file tree
Showing 25 changed files with 5,103 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ to that directory and its relative sub-directories.
The relevant directories and licenses are:

design/ - Apache License 2.0
spec/document/ - W3C Software and Document Notice and License

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

Expand Down
2 changes: 2 additions & 0 deletions spec/document/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_build/
util/__pycache__
50 changes: 50 additions & 0 deletions spec/document/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE

This work is being provided by the copyright holders under the following
license.


LICENSE

By obtaining and/or copying this work, you (the licensee) agree that you have
read, understood, and will comply with the following terms and conditions.

Permission to copy, modify, and distribute this work, with or without
modification, for any purpose and without fee or royalty is hereby granted,
provided that you include the following on ALL copies of the work or portions
thereof, including modifications:

* The full text of this NOTICE in a location viewable to users of the
redistributed or derivative work.

* Any pre-existing intellectual property disclaimers, notices, or terms and
conditions. If none exist, the W3C Software and Document Short Notice
(https://www.w3.org/Consortium/Legal/copyright-software-short-notice) should
be included.

* Notice of any changes or modifications, through a copyright statement on the
new code or document such as "This software or document includes material
copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)."


DISCLAIMERS

THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS
OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE
SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
TRADEMARKS OR OTHER RIGHTS.

COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT.

The name and trademarks of copyright holders may NOT be used in advertising or
publicity pertaining to the work without specific, written prior permission.
Title to copyright in this work will at all times remain with copyright
holders.


NOTES

This version:
http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
50 changes: 50 additions & 0 deletions spec/document/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -d _build/.doctrees
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

SOURCE_DATE_EPOCH = $(shell date +"%s")

ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: html
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
for file in `ls $(BUILDDIR)/html/*.html`; \
do \
sed s:BASEDIR:.:g <$$file >$$file.out; \
mv -f $$file.out $$file; \
done
for file in `ls $(BUILDDIR)/html/*/*.html`; \
do \
sed s:BASEDIR:..:g <$$file >$$file.out; \
mv -f $$file.out $$file; \
done
@echo
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html/."

NAME=webassemblycomponentmodel

.PHONY: docs
docs: html latexpdf
mkdir -p ../../docs/multihtml/
cp -r $(BUILDDIR)/html/* ../../docs/multihtml/
rm ../../docs/multihtml/objects.inv
mkdir -p ../../docs/_download/
cp $(BUILDDIR)/latex/$(NAME).pdf ../../docs/_download/
4 changes: 4 additions & 0 deletions spec/document/appendix/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _appendix:

Appendix
========
6 changes: 6 additions & 0 deletions spec/document/binary/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _binary:

Binary Format
=============

TODO: Formal write-up of the binary format.
83 changes: 83 additions & 0 deletions spec/document/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
from datetime import date
sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

name = 'WebAssembly Component Model'
project = 'WebAssembly Component Model'
title = 'WebAssembly Component Model Specification'
copyright = '2022 WebAssembly Community Group'
author = 'Authors of the Webassembly Component Model Specification'

version = u'0.0'
# The draft version string (clear out for release cuts)
draft = ' (Draft ' + date.today().strftime("%Y-%m-%d") + ')'
# The full version, including alpha/beta/rc tags.
release = version + draft

mathjax_path='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.mathjax',
'util.mathdef'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme_options = {
'description': 'WebAssembly Component Model Specification',
'fixed_sidebar': True,
'sidebar_width': '260px',
'sidebar_collapse': True,
'show_powered_by': False,
'extra_nav_links': {
'Index': 'BASEDIR/genindex.html',
'Download as PDF': 'BASEDIR/../_download/webassemblycomponentmodel.pdf'
},
}
html_title = project +u' ' + release
html_copy_source = False # At least for the one included in docs/ ...

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']

pwd = os.path.abspath('.')
rst_prolog = """
.. include:: /""" + pwd + """/util/macros-core.def
.. include:: /""" + pwd + """/util/macros.def
"""
9 changes: 9 additions & 0 deletions spec/document/exec/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. _exec:

Execution
=========

TODO: Describe the execution semantics of a component

.. toctree::
:maxdepth: 2
26 changes: 26 additions & 0 deletions spec/document/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. wasm components documentation master file, created by
sphinx-quickstart on Wed Sep 22 14:51:32 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to the WebAssembly Component Model Specification
========================================================

.. toctree::
:maxdepth: 2
:caption: Contents:

intro/index
syntax/index
valid/index
exec/index
binary/index
text/index
appendix/index

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
6 changes: 6 additions & 0 deletions spec/document/intro/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _intro:

Introduction
============

TODO: Introduction
5 changes: 5 additions & 0 deletions spec/document/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ nixpkgs ? import <nixpkgs> {} }: with nixpkgs;
stdenv.mkDerivation {
name = "wasm-components-spec";
buildInputs = [ gnumake sphinx texlive.combined.scheme-full ];
}

0 comments on commit 9a40737

Please sign in to comment.