Skip to content

Commit 59060c3

Browse files
committed
Merge all documentation into one location
This PR is aimed at making the this repository, and the `rustwasm.github.io` domain, the one stop shop for all documentation for Rust and WebAssembly. Currently we have a number of sources of documentation: * https://rustwasm.github.io/book - a tutorial and guide to Rust and WebAssembly * https://rustwasm.github.io/wasm-bindgen - a tutorial and guide specific to `wasm-bindgen` * https://rustwasm.github.io/wasm-pack - a tutorial and guide specific to `wasm-pack` * https://rustwasm.github.io/ - the Rust and WebAssembly blog This commit reorganizes all of these properties to instead be deployed in this repository in one location, hopefully making it easier to discover more of them and also cross-link between them. The setup here is somewhat similar to the Rust documentation itself, comprising of a number of books. When this site is built it will clone the book, wasm-bindgen, and wasm-pack repositories. The latter two will be reset to their most recent tag, matching the most recently published version on crates.io. All books are then compiled with `mdbook` and placed into the output here. The current set is then laid out as follows: * https://rustwasm.github.io/ - landing page, button to install wasm-pack, links everywhere else * https://rustwasm.github.io/blog.html - new home for the blog * https://rustwasm.github.io/docs.html - dispatch point for documentation I'm hoping that we can centralize here by using https://rustwasm.github.io if anyone wants an entry point or an easy-click installer and using `/docs.html` as the main location for documentation. Once this lands I'd like to update the deployments of the book, wasm-bindgen, and wasm-pack. All those books will gain a banner saying they're a "nightly preview" with links to the officially published versions. This means that visiting https://rustwasm.github.io/book will have a banner saying you should go to https://rustwasm.github.io/docs/book instead basically. The landing page at https://rustwasm.github.io/wasm-pack will probably stay for now (and the installer page will definitely stay), but we likely won't link to it much any more. Finally for a deployment strategy I hope to turn this into a daily cron job for this repository. That means we'll redeploy everything at least once a day, picking up any changes naturally. If we want to manually trigger a redeploy, however, we can simply reexecute the previous build on Travis.
1 parent ab3bfca commit 59060c3

File tree

12 files changed

+159
-71
lines changed

12 files changed

+159
-71
lines changed

Diff for: .gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ _site
33
.jekyll-metadata
44
.bundle
55
vendor
6+
repos/wasm-bindgen
7+
repos/book
8+
repos/wasm-pack
9+
_site
10+
_build.yml

Diff for: .travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: rust
2+
3+
before_install:
4+
- curl -L https://github.com/rust-lang-nursery/mdBook/releases/download/v0.2.1/mdbook-v0.2.1-x86_64-unknown-linux-musl.tar.gz | tar xzf -
5+
- export PATH=$PATH:`pwd`
6+
- bundler install
7+
8+
script:
9+
- ./ci/build.sh
10+
11+
deploy:
12+
provider: script
13+
script: curl -LsSf https://git.io/fhJ8n | rustc - && (cd _site && ../rust_out)
14+
skip_cleanup: true
15+
on:
16+
branch: master

Diff for: _config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ plugins:
3333
exclude:
3434
- template.md
3535
- vendor/bundle/
36+
- repos
3637
# - Gemfile
3738
# - Gemfile.lock
3839
# - node_modules

Diff for: _includes/header.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
</label>
2323

2424
<div class="trigger">
25-
<a class="page-link" href="https://rustwasm.github.io/book/">📚 Learn</a>
25+
<a class="page-link" href="/docs.html">📚 Learn</a>
26+
<a class="page-link" href="/blog.html">📖 Blog</a>
2627
<a class="page-link" href="https://github.com/rustwasm/team/blob/master/README.md#get-involved">👯 Get Involved</a>
2728
{%- for path in page_paths -%}
2829
{%- assign my_page = site.pages | where: "path", path | first -%}

Diff for: _layouts/blog.html

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
layout: default
3+
---
4+
{{ content }}
5+
6+
{%- if site.posts.size > 0 -%}
7+
<section>
8+
<h2 class="post-list-heading">{{ page.list_title | default: "Blog Posts" }}</h2>
9+
<ul class="post-list">
10+
{%- for post in site.posts -%}
11+
<li>
12+
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
13+
<span class="post-meta">{{ post.date | date: date_format }}</span>
14+
<h3>
15+
<a class="post-link" href="{{ post.url | relative_url }}">
16+
{{ post.title | escape }}
17+
</a>
18+
</h3>
19+
{%- if site.show_excerpts -%}
20+
{{ post.excerpt }}
21+
{%- endif -%}
22+
</li>
23+
{%- endfor -%}
24+
</ul>
25+
26+
<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</a></p>
27+
</section>
28+
{%- endif -%}

Diff for: _layouts/default.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
{%- include header.html -%}
99

1010
<main class="page-content" aria-label="Content">
11+
{%- if layout.unwrapped -%}
12+
{{ content }}
13+
{%- else -%}
1114
<div class="wrapper">
1215
{{ content }}
1316
</div>
17+
{%- endif -%}
1418
</main>
1519

1620
{%- include footer.html -%}
@@ -19,4 +23,4 @@
1923

2024
</body>
2125

22-
</html>
26+
</html>

Diff for: _layouts/home.html

+25-69
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,27 @@
11
---
2+
layout: default
3+
unwrapped: true
24
---
3-
4-
<!DOCTYPE html>
5-
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
6-
7-
{%- include head.html -%}
8-
9-
<body>
10-
11-
{%- include header.html -%}
12-
13-
<main class="page-content" aria-label="Content">
14-
<div class="home">
15-
{%- if page.title -%}
16-
<h1 class="page-heading">{{ page.title }}</h1>
17-
{%- endif -%}
18-
19-
<section id="call-to-action">
20-
<div class="wrapper">
21-
<img src="{{ "/assets/wasm-ferris.png" | relative_url }}"/>
22-
<h2>Learn Rust and WebAssembly</h2>
23-
<p>
24-
<a href="https://rustwasm.github.io/book/">Read the Rust and WebAssembly book</a> to
25-
learn how to design, develop, test, debug, profile, and publish Rust and
26-
WebAssembly libraries and applications.
27-
</p>
28-
<h2>Get Involved</h2>
29-
<p>
30-
<a href="https://github.com/rustwasm/team/blob/master/README.md#get-involved">Join the Rust and WebAssembly domain working group!</a> Help us craft the future of Rust and WebAssembly.
31-
</p>
32-
</div>
33-
</section>
34-
35-
{{ content }}
36-
37-
<div class="wrapper">
38-
{%- if site.posts.size > 0 -%}
39-
<section>
40-
<h2 class="post-list-heading">{{ page.list_title | default: "Blog Posts" }}</h2>
41-
<ul class="post-list">
42-
{%- for post in site.posts -%}
43-
<li>
44-
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
45-
<span class="post-meta">{{ post.date | date: date_format }}</span>
46-
<h3>
47-
<a class="post-link" href="{{ post.url | relative_url }}">
48-
{{ post.title | escape }}
49-
</a>
50-
</h3>
51-
{%- if site.show_excerpts -%}
52-
{{ post.excerpt }}
53-
{%- endif -%}
54-
</li>
55-
{%- endfor -%}
56-
</ul>
57-
58-
<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</a></p>
59-
</section>
60-
{%- endif -%}
61-
</div>
62-
</div>
63-
</main>
64-
65-
{%- include footer.html -%}
66-
67-
{%- include analytics.html -%}
68-
69-
</body>
70-
71-
</html>
5+
{%- if page.title -%}
6+
<h1 class="page-heading">{{ page.title }}</h1>
7+
{%- endif -%}
8+
9+
<section id="call-to-action">
10+
<div class="wrapper">
11+
<img src="{{ "/assets/wasm-ferris.png" | relative_url }}"/>
12+
<h2>Learn Rust and WebAssembly</h2>
13+
<p>
14+
<a href="docs.html">Read the Rust and WebAssembly documentation</a> to
15+
learn how to design, develop, test, debug, profile, and publish Rust and
16+
WebAssembly libraries and applications.
17+
</p>
18+
<h2>Get Involved</h2>
19+
<p>
20+
<a href="https://github.com/rustwasm/team/blob/master/README.md#get-involved">Join the Rust and WebAssembly domain working group!</a> Help us craft the future of Rust and WebAssembly.
21+
</p>
22+
</div>
23+
</section>
24+
25+
<div class="wrapper">
26+
{{ content }}
27+
</div>

Diff for: assets/extra.css

+20
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,23 @@
2323
section {
2424
clear: both;
2525
}
26+
27+
#installer {
28+
text-align: center;
29+
}
30+
31+
#installer .button {
32+
background-color: #6556EC;
33+
border-color: #6556EC;
34+
height: 20%;
35+
font-size: 1.8rem;
36+
padding: 1.8rem;
37+
color: #fff;
38+
font-weight: 600;
39+
line-height: 38px;
40+
border-radius: 4px;
41+
display: inline-block;
42+
}
43+
#installer .button:hover {
44+
text-decoration: none;
45+
}

Diff for: blog.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# You don't need to edit this file, it's empty on purpose.
3+
# Edit theme's home layout instead if you wanna make some changes
4+
# See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults
5+
layout: blog
6+
---
7+

Diff for: ci/build.sh

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
set -ex
3+
4+
mkdir -p repos
5+
6+
if [ ! -d repos/wasm-bindgen ]; then
7+
git clone https://github.com/rustwasm/wasm-bindgen repos/wasm-bindgen
8+
fi
9+
if [ ! -d repos/wasm-pack ]; then
10+
git clone https://github.com/rustwasm/wasm-pack repos/wasm-pack
11+
fi
12+
if [ ! -d repos/book ]; then
13+
git clone https://github.com/rustwasm/book repos/book
14+
fi
15+
16+
wasm_bindgen_tag=$(cd repos/wasm-bindgen && git describe --abbrev=0 --tags)
17+
wasm_pack_tag=$(cd repos/wasm-pack && git describe --abbrev=0 --tags)
18+
19+
(cd repos/wasm-bindgen && git reset --hard $wasm_bindgen_tag)
20+
(cd repos/wasm-pack && git reset --hard $wasm_pack_tag)
21+
22+
wasm_pack_publish_date=$(date -d "@$(cd repos/wasm-pack && git show -s --format=%at)" "+%b %e")
23+
24+
echo "wasm-pack-tag: $wasm_pack_tag" >> _build.yml
25+
echo "wasm-pack-publish-date: $wasm_pack_publish_date" >> _build.yml
26+
27+
bundler exec jekyll build --config _config.yml,_build.yml
28+
29+
mkdir -p _site/docs
30+
mdbook build repos/wasm-bindgen/guide
31+
mv repos/wasm-bindgen/guide/book _site/docs/wasm-bindgen
32+
33+
mdbook build repos/wasm-pack/docs
34+
mv repos/wasm-pack/docs/book _site/docs/wasm-pack
35+
36+
mdbook build repos/book
37+
mv repos/book/book _site/docs/book
38+

Diff for: docs.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* [The rustwasm book](docs/book)
2+
* [The wasm-bindgen book](docs/wasm-bindgen)
3+
* [The wasm-pack book](docs/wasm-pack)

Diff for: index.md

+9
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@
44
# See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults
55
layout: home
66
---
7+
8+
<div id="installer">
9+
<a class="button button-primary" href="https://rustwasm.github.io/wasm-pack/installer">✨ Install wasm-pack 0.6.0 ✨</a>
10+
<p>{{ site.wasm-pack-publish-date }} |
11+
<a href="https://github.com/rustwasm/wasm-pack/releases/tag/{{- site.wasm-pack-tag -}}">
12+
Release Notes
13+
</a>
14+
</p>
15+
</div>

0 commit comments

Comments
 (0)