» About this site
The site is built using Sphinx (2.4.4), the open source tool used to create the official Python documentation and many other sites. This is a very mature and stable tool, and was selected for, among other reasons, its support for defining API items and linking to them from code.
The site uses a custom theme, which is based on the Read the docs theme.
Searching returns topics that contain all the specified keywords.
Always start by searching for single words like “interacting” or “compiling”. Generally this will be enough to find the relevant document. If not, you can refine the search by adding additional terms.
Searches that include characters like “-” and “+” will not work. There is no support for logical operators.
Contributions to this site (and indeed any part of Emscripten) are welcome!
The site sources are stored on GitHub. Edits and additions should be submitted to this branch in the same way as any other change to the tool.
The site is published to the emscripten-core/emscripten-site gh-pages branch (GitHub pages).
Remember to update the Build version for public builds.
This site requires a specific version of Sphinx to be installed. Run the following command to ensure you have the correct version installed:
pip install -r requirements-dev.txt
The site can be built from source on Ubuntu and Windows by navigating to the /emscripten/site directory and using the command:
SDK builds are enabled by enabling the
sdkbuild tag. This is done through the
SPHINXOPTS environment variable:
# Set the sdkbuild tag.
set SPHINXOPTS=-t sdkbuild
# Unset SPHINXOPTS
The documentation version should match the Emscripten version for the current build. For a general site build this will be the latest tagged release as defined in Emscripten version. For an SDK build it will be the Emscripten version for the SDK.
The version and release information is used in a few places in the documentation, for example AUTHORS.
The version information is defined in conf.py — see variables
release. These variables can be overridden by setting new values in the
SPHINXOPTS environment variable. For example, to update the
release variable through the command line on Windows:
# Set SPHINXOPTS
set SPHINXOPTS=-D release=6.40
# Unset SPHINXOPTS
Sphinx is well documented. This section only attempts to highlight specific styles and features used on this site.
The Building the site section explains how to find the sources for articles and build the site.
Site content is written using reStructured text. We recommend you read the following articles to understand the syntax:
This section has a few very brief recommendations to help authors use common style.
In terms of contributions, we value your coding and content writing far more than perfect prose! Just do your best, and then ask for editorial review.
Spelling: Where possible use US-English spelling.
Avoid idiomatic expressions: These can be particularly confusing to non-native speakers (for example “putting your foot in your mouth” actually means “saying something embarrassing”).
Bold : use for file names, and UI/menu instructions (for example: “Press OK to do something”).
Italic : use for tool names - e.g. Clang, emcc, Closure Compiler.
monotype: use for inline code (where you can’t link to the API reference) and for demonstrating tool command line options.
Other than the above rules, emphasis should be used sparingly.
Lists: Use a colon on the lead-in to the list where appropriate. Capitalize the first letter and use a full-stop for each item.
reStructured text defines section headings using a separate line of punctuation characters after (and optionally before) the heading text. The line of characters must be at least as long as the heading. For example:
Different punctuation characters are used to specify nested sections. Although the system does not mandate which punctuation character is used for each nested level, it is important to be consistent. The recommended heading levels are:
Page title (top and bottom bars of "=")
Level 1 heading (single bar of "=" below)
Level 2 heading (single bar of "-" below)
Level 3 heading (single bar of "+" below)
Level 4 heading (single bar of "~" below)
New articles may be authored and discussed on the wiki using Markdown syntax before being included in the documentation set. The easiest way to convert these to restructured text is to use a tool like Pandoc.
The get_wiki.py tool (/site/source/get_wiki.py) can be used to automate getting a snapshot of the wiki. It clones the wiki and calls pandoc on each file. The output is copied to a folder wiki_static. The tool also adds a heading, a note stating that the file is a “wiki snapshot”, and fixes up links marked as “inline code” to matching links in the API Reference.
The site uses a modification of the Read the docs theme (this can be found in the source at /emscripten/site/source/_themes/emscripten_sphinx_rtd_theme).
The main changes to the original theme are listed below.
Copyright changed to link to Emscripten authors (some code was broken by translation markup)
Added footer menu bar
Added header menu bar with items
Changed the text of the first link from “docs” to “Home”
Moved the “View Page Source” code into the bottom footer
Changed to support 4 levels of depth in sidebar toc.
Centred theme. Made sidebar reach bottom of page using absolute positioning.