Skip to content

Commit 3368566

Browse files
authored
Prettier (#417)
1 parent 2f9051e commit 3368566

28 files changed

+3123
-2412
lines changed

.github/workflows/ci.yml

+39-37
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
test:
@@ -13,21 +13,23 @@ jobs:
1313
permissions: {}
1414

1515
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v3
18-
with:
19-
submodules: false # Currently not necessary
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
submodules: false # Currently not necessary
2020

21-
- name: Set up Node
22-
uses: actions/setup-node@v3
23-
with:
24-
node-version: 18
21+
- name: Set up Node
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 18
2525

26-
- name: Install JSON validator
27-
run: npm install -g ajv-cli@5 ajv-formats@2
26+
- name: Install JSON validator
27+
run: npm install -g ajv-cli@5 ajv-formats@2
2828

29-
- name: Validate features table
30-
run: ajv -c ajv-formats -s features.schema.json -d features.json --strict=true --errors=text
29+
- name: Validate features table
30+
run:
31+
ajv -c ajv-formats -s features.schema.json -d features.json
32+
--strict=true --errors=text
3133

3234
build:
3335
name: Build & Deploy
@@ -36,26 +38,26 @@ jobs:
3638
contents: write
3739

3840
steps:
39-
- name: Checkout
40-
uses: actions/checkout@v3
41-
with:
42-
submodules: recursive
43-
44-
- name: Set up Ruby
45-
uses: ruby/setup-ruby@v1
46-
with:
47-
ruby-version: 2.7
48-
bundler-cache: true
49-
50-
- name: Build
51-
run: bundle exec jekyll build
52-
53-
- name: Deploy
54-
if: github.event_name == 'push'
55-
uses: peaceiris/actions-gh-pages@v3
56-
with:
57-
github_token: ${{ secrets.GITHUB_TOKEN }}
58-
publish_dir: docs
59-
user_name: 'github-actions[bot]'
60-
user_email: 'github-actions[bot]@users.noreply.github.com'
61-
exclude_assets: ''
41+
- name: Checkout
42+
uses: actions/checkout@v3
43+
with:
44+
submodules: recursive
45+
46+
- name: Set up Ruby
47+
uses: ruby/setup-ruby@v1
48+
with:
49+
ruby-version: 2.7
50+
bundler-cache: true
51+
52+
- name: Build
53+
run: bundle exec jekyll build
54+
55+
- name: Deploy
56+
if: github.event_name == 'push'
57+
uses: peaceiris/actions-gh-pages@v3
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
publish_dir: docs
61+
user_name: 'github-actions[bot]'
62+
user_email: 'github-actions[bot]@users.noreply.github.com'
63+
exclude_assets: ''

.github/workflows/purge.yml

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on: page_build
44

55
jobs:
66
purge:
7-
87
runs-on: ubuntu-latest
98

109
steps:

.prettierignore

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

.prettierrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"htmlWhitespaceSensitivity": "css",
5+
"insertPragma": false,
6+
"bracketSameLine": false,
7+
"jsxSingleQuote": false,
8+
"printWidth": 80,
9+
"proseWrap": "always",
10+
"quoteProps": "as-needed",
11+
"requirePragma": false,
12+
"semi": true,
13+
"singleQuote": true,
14+
"tabWidth": 2,
15+
"trailingComma": "es5",
16+
"useTabs": false,
17+
"vueIndentScriptAndStyle": false
18+
}

README.md

+32-11
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,42 @@ $ bundle exec jekyll build
2929
$ bundle exec jekyll serve
3030
```
3131

32-
> You must run `bundle exec jekyll build` after every change and include the `docs` directory in your commit!
32+
> You must run `bundle exec jekyll build` after every change and include the
33+
> `docs` directory in your commit!
3334
3435
## Publishing
3536

36-
This site uses Jekyll plugins, so GitHub Pages will not build it automatically. To publish, check in manually built static site files to the `docs` directory.
37+
This site uses Jekyll plugins, so GitHub Pages will not build it automatically.
38+
To publish, check in manually built static site files to the `docs` directory.
3739

38-
The static site should be configured to build to the `docs` directory. The `docs` directory is a special directory from which GitHub pages can publish directly. The naming convention is unfortunate given the confusing overlap with the site's own `docs` pages (output to `docs/docs`) which are themselves generated from the design docs submodule located at `design`.
40+
The static site should be configured to build to the `docs` directory. The
41+
`docs` directory is a special directory from which GitHub pages can publish
42+
directly. The naming convention is unfortunate given the confusing overlap with
43+
the site's own `docs` pages (output to `docs/docs`) which are themselves
44+
generated from the design docs submodule located at `design`.
3945

4046
## What is the role of `_config.yml` and the custom Jekyll plugins?
4147

42-
> Note: the following plugins are all hacks to make the workflow of generating website docs from the `design` repo work without updating the sources in the design repo.
43-
44-
- `gem 'jekyll-optional-front-matter'` loaded directly in the `Gemfile` allows markdown files without YAML frontmatter to be consumed directly. This is included to allow `design` repo `.md` files to be used as pages without modifying their source to add frontmatter.
45-
- `gem 'jemoji'` loaded directly in the `Gemfile` replaces GitHub-style emoji markdown (e.g. `:+1:`) with images for compat.
46-
- The `defaults` section of `_config.yml` adds default values to the YAML frontmatter of documents from the `design` repo. In particular, it specifies that all `.md` files in the design submodule should be labelled as type `doc` and given layout `doc.html`. It also manually moves a few docs into the `community` tree where they fit the site organization better.
47-
- `auto_titles.rb` adds a `title` value to YAML frontmatter by looking for the first header tag in the source files. It also orders the design docs based on a hardcoded list.
48-
- `link_converter.rb` turns the `design` repo's links (e.g. `[threads](FutureFeatures.md#threads)`) into their respective locations on this website (e.g. `[threads](/docs/future-features/#threads)`).
49-
- `underscore_paths.rb` rewrites Jekyll page permalinks to convert `/design/FutureFeatures/` to `/docs/future-features/`.
48+
> Note: the following plugins are all hacks to make the workflow of generating
49+
> website docs from the `design` repo work without updating the sources in the
50+
> design repo.
51+
52+
- `gem 'jekyll-optional-front-matter'` loaded directly in the `Gemfile` allows
53+
markdown files without YAML frontmatter to be consumed directly. This is
54+
included to allow `design` repo `.md` files to be used as pages without
55+
modifying their source to add frontmatter.
56+
- `gem 'jemoji'` loaded directly in the `Gemfile` replaces GitHub-style emoji
57+
markdown (e.g. `:+1:`) with images for compat.
58+
- The `defaults` section of `_config.yml` adds default values to the YAML
59+
frontmatter of documents from the `design` repo. In particular, it specifies
60+
that all `.md` files in the design submodule should be labelled as type `doc`
61+
and given layout `doc.html`. It also manually moves a few docs into the
62+
`community` tree where they fit the site organization better.
63+
- `auto_titles.rb` adds a `title` value to YAML frontmatter by looking for the
64+
first header tag in the source files. It also orders the design docs based on
65+
a hardcoded list.
66+
- `link_converter.rb` turns the `design` repo's links (e.g.
67+
`[threads](FutureFeatures.md#threads)`) into their respective locations on
68+
this website (e.g. `[threads](/docs/future-features/#threads)`).
69+
- `underscore_paths.rb` rewrites Jekyll page permalinks to convert
70+
`/design/FutureFeatures/` to `/docs/future-features/`.

_config.yml

+41-45
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,53 @@
11
name: WebAssembly
22

3-
include: [
4-
.github
5-
]
3+
include: [.github]
64

7-
exclude: [
8-
README.md,
9-
LICENSE,
10-
Gemfile,
11-
Gemfile.lock,
12-
design/LICENSE,
13-
design/Contributing.md,
14-
design/README.md,
15-
design/tools,
16-
design/JS.md,
17-
design/BinaryEncoding.md,
18-
design/TextFormat.md,
19-
design/Semantics.md,
20-
design/Nondeterminism.md,
21-
design/Rationale.md,
22-
design/MVP.md,
23-
design/Modules.md,
24-
design/FutureFeatures.md,
25-
design/FeatureTest.md,
26-
design/JITLibrary.md,
27-
design/DynamicLinking.md,
28-
design/CAndC++.md,
29-
docs,
30-
vendor
31-
]
5+
exclude:
6+
[
7+
README.md,
8+
LICENSE,
9+
Gemfile,
10+
Gemfile.lock,
11+
design/LICENSE,
12+
design/Contributing.md,
13+
design/README.md,
14+
design/tools,
15+
design/JS.md,
16+
design/BinaryEncoding.md,
17+
design/TextFormat.md,
18+
design/Semantics.md,
19+
design/Nondeterminism.md,
20+
design/Rationale.md,
21+
design/MVP.md,
22+
design/Modules.md,
23+
design/FutureFeatures.md,
24+
design/FeatureTest.md,
25+
design/JITLibrary.md,
26+
design/DynamicLinking.md,
27+
design/CAndC++.md,
28+
docs,
29+
vendor,
30+
]
3231

3332
destination: docs
3433

3534
permalink: pretty
3635

3736
defaults:
38-
-
39-
scope:
40-
path: "design"
37+
- scope:
38+
path: 'design'
4139
values:
42-
layout: "doc"
43-
type: "doc"
44-
-
45-
scope:
46-
path: "design/CodeOfConduct.md"
40+
layout: 'doc'
41+
type: 'doc'
42+
- scope:
43+
path: 'design/CodeOfConduct.md'
4744
values:
48-
layout: "community"
49-
type: "community"
50-
permalink: "/community/code-of-conduct/"
51-
-
52-
scope:
53-
path: "design/Events.md"
45+
layout: 'community'
46+
type: 'community'
47+
permalink: '/community/code-of-conduct/'
48+
- scope:
49+
path: 'design/Events.md'
5450
values:
55-
layout: "community"
56-
type: "community"
57-
permalink: "/community/events/"
51+
layout: 'community'
52+
type: 'community'
53+
permalink: '/community/events/'

_includes/footer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
</body>
1+
</body>
22
</html>

_includes/header.html

+41-31
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
6-
<meta name="color-scheme" content="dark light">
7-
<title>{% if page.url == "/" %}WebAssembly{% else %}{{ page.title }} - WebAssembly{% endif %}</title>
8-
<link rel="stylesheet" type="text/css" href="/css/custom.css">
9-
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
10-
<link rel="icon" href="/favicon.ico" type="image/x-icon">
11-
</head>
12-
<body>
13-
<header class="page-section">
14-
<div class="container-narrow">
15-
<a class="site-logo" href="/" title="WebAssembly"></a>
16-
<nav class="site-nav">
17-
<a class="site-nav-item btn" href="/">Overview</a>
18-
<a class="site-nav-item btn" href="/getting-started/developers-guide/">Getting Started</a>
19-
<a class="site-nav-item btn" href="/specs">Specs</a>
20-
<a class="site-nav-item btn" href="/docs/faq/">Docs</a>
21-
<a class="site-nav-item btn" href="/features/">Feature Extensions</a>
22-
<a class="site-nav-item btn" href="/community/resources/">Community</a>
23-
</nav>
24-
</div>
25-
</header>
26-
{% if page.lead %}
27-
<section class="page-section-spacious flush-bottom">
28-
<div class="container-narrow">
29-
<p class="lead">{{page.lead}}</p>
30-
</div>
31-
</section>
32-
{% endif %}
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"
8+
/>
9+
<meta name="color-scheme" content="dark light" />
10+
<title>
11+
{% if page.url == "/" %}WebAssembly{% else %}{{ page.title }} -
12+
WebAssembly{% endif %}
13+
</title>
14+
<link rel="stylesheet" type="text/css" href="/css/custom.css" />
15+
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
16+
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
17+
</head>
18+
<body>
19+
<header class="page-section">
20+
<div class="container-narrow">
21+
<a class="site-logo" href="/" title="WebAssembly"></a>
22+
<nav class="site-nav">
23+
<a class="site-nav-item btn" href="/">Overview</a>
24+
<a class="site-nav-item btn" href="/getting-started/developers-guide/"
25+
>Getting Started</a
26+
>
27+
<a class="site-nav-item btn" href="/specs">Specs</a>
28+
<a class="site-nav-item btn" href="/docs/faq/">Docs</a>
29+
<a class="site-nav-item btn" href="/features/">Feature Extensions</a>
30+
<a class="site-nav-item btn" href="/community/resources/"
31+
>Community</a
32+
>
33+
</nav>
34+
</div>
35+
</header>
36+
{% if page.lead %}
37+
<section class="page-section-spacious flush-bottom">
38+
<div class="container-narrow">
39+
<p class="lead">{{page.lead}}</p>
40+
</div>
41+
</section>
42+
{% endif %}

_layouts/community.html

+13-7
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@
22
<section>
33
<div class="container">
44
<div class="row">
5-
<div class="col-xs-12 col-lg-9 col-pop">
6-
{{content}}
7-
</div>
5+
<div class="col-xs-12 col-lg-9 col-pop">{{content}}</div>
86
<div class="col-xs-12 col-lg-3">
97
<h6 class="side-title">Community</h6>
108
<nav class="side-nav">
119
<a class="side-nav-item" href="/community/resources/">Resources</a>
1210
<a class="side-nav-item" href="/community/feedback/">Feedback</a>
13-
<a class="side-nav-item" href="/community/contributing/">Contributing</a>
14-
<a class="side-nav-item" href="/community/code-of-conduct/">Code of Conduct</a>
15-
<a class="side-nav-item" href="https://www.w3.org/community/webassembly/">W3C Community Group</a>
11+
<a class="side-nav-item" href="/community/contributing/"
12+
>Contributing</a
13+
>
14+
<a class="side-nav-item" href="/community/code-of-conduct/"
15+
>Code of Conduct</a
16+
>
17+
<a
18+
class="side-nav-item"
19+
href="https://www.w3.org/community/webassembly/"
20+
>W3C Community Group</a
21+
>
1622
</nav>
1723
</div>
1824
</div>
1925
</div>
2026
</section>
21-
{% include footer.html %}
27+
{% include footer.html %}

0 commit comments

Comments
 (0)