From 59060c34b72460f03a425cd537fdfa87efc3601c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 17 Jan 2019 11:34:07 -0800 Subject: [PATCH 1/6] 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. --- .gitignore | 5 +++ .travis.yml | 16 ++++++++ _config.yml | 1 + _includes/header.html | 3 +- _layouts/blog.html | 28 +++++++++++++ _layouts/default.html | 6 ++- _layouts/home.html | 94 ++++++++++++------------------------------- assets/extra.css | 20 +++++++++ blog.md | 7 ++++ ci/build.sh | 38 +++++++++++++++++ docs.md | 3 ++ index.md | 9 +++++ 12 files changed, 159 insertions(+), 71 deletions(-) create mode 100644 .travis.yml create mode 100644 _layouts/blog.html create mode 100644 blog.md create mode 100755 ci/build.sh create mode 100644 docs.md diff --git a/.gitignore b/.gitignore index 5dfb980..278eeb4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,8 @@ _site .jekyll-metadata .bundle vendor +repos/wasm-bindgen +repos/book +repos/wasm-pack +_site +_build.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..46bfd2e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: rust + +before_install: + - 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 - + - export PATH=$PATH:`pwd` + - bundler install + +script: + - ./ci/build.sh + +deploy: + provider: script + script: curl -LsSf https://git.io/fhJ8n | rustc - && (cd _site && ../rust_out) + skip_cleanup: true + on: + branch: master diff --git a/_config.yml b/_config.yml index b97d1d5..a65bb08 100644 --- a/_config.yml +++ b/_config.yml @@ -33,6 +33,7 @@ plugins: exclude: - template.md - vendor/bundle/ + - repos # - Gemfile # - Gemfile.lock # - node_modules diff --git a/_includes/header.html b/_includes/header.html index ddca3b8..4f84592 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -22,7 +22,8 @@
- 📚 Learn + 📚 Learn + 📖 Blog 👯 Get Involved {%- for path in page_paths -%} {%- assign my_page = site.pages | where: "path", path | first -%} diff --git a/_layouts/blog.html b/_layouts/blog.html new file mode 100644 index 0000000..3937c61 --- /dev/null +++ b/_layouts/blog.html @@ -0,0 +1,28 @@ +--- +layout: default +--- +{{ content }} + +{%- if site.posts.size > 0 -%} +
+

{{ page.list_title | default: "Blog Posts" }}

+
    + {%- for post in site.posts -%} +
  • + {%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%} + +

    + + {{ post.title | escape }} + +

    + {%- if site.show_excerpts -%} + {{ post.excerpt }} + {%- endif -%} +
  • + {%- endfor -%} +
+ +

subscribe via RSS

+
+{%- endif -%} diff --git a/_layouts/default.html b/_layouts/default.html index bf6def4..5105d2a 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -8,9 +8,13 @@ {%- include header.html -%}
+ {%- if layout.unwrapped -%} + {{ content }} + {%- else -%}
{{ content }}
+ {%- endif -%}
{%- include footer.html -%} @@ -19,4 +23,4 @@ - \ No newline at end of file + diff --git a/_layouts/home.html b/_layouts/home.html index 2702001..57b4a0a 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -1,71 +1,27 @@ --- +layout: default +unwrapped: true --- - - - - - {%- include head.html -%} - - - - {%- include header.html -%} - -
-
- {%- if page.title -%} -

{{ page.title }}

- {%- endif -%} - -
-
- -

Learn Rust and WebAssembly

-

- Read the Rust and WebAssembly book to - learn how to design, develop, test, debug, profile, and publish Rust and - WebAssembly libraries and applications. -

-

Get Involved

-

- Join the Rust and WebAssembly domain working group! Help us craft the future of Rust and WebAssembly. -

-
-
- - {{ content }} - -
- {%- if site.posts.size > 0 -%} -
-

{{ page.list_title | default: "Blog Posts" }}

-
    - {%- for post in site.posts -%} -
  • - {%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%} - -

    - - {{ post.title | escape }} - -

    - {%- if site.show_excerpts -%} - {{ post.excerpt }} - {%- endif -%} -
  • - {%- endfor -%} -
- -

subscribe via RSS

-
- {%- endif -%} -
-
-
- - {%- include footer.html -%} - - {%- include analytics.html -%} - - - - +{%- if page.title -%} +

{{ page.title }}

+{%- endif -%} + +
+
+ +

Learn Rust and WebAssembly

+

+ Read the Rust and WebAssembly documentation to + learn how to design, develop, test, debug, profile, and publish Rust and + WebAssembly libraries and applications. +

+

Get Involved

+

+ Join the Rust and WebAssembly domain working group! Help us craft the future of Rust and WebAssembly. +

+
+
+ +
+ {{ content }} +
diff --git a/assets/extra.css b/assets/extra.css index 797302f..ea7a879 100644 --- a/assets/extra.css +++ b/assets/extra.css @@ -23,3 +23,23 @@ section { clear: both; } + +#installer { + text-align: center; +} + +#installer .button { + background-color: #6556EC; + border-color: #6556EC; + height: 20%; + font-size: 1.8rem; + padding: 1.8rem; + color: #fff; + font-weight: 600; + line-height: 38px; + border-radius: 4px; + display: inline-block; +} +#installer .button:hover { + text-decoration: none; +} diff --git a/blog.md b/blog.md new file mode 100644 index 0000000..0eb25d7 --- /dev/null +++ b/blog.md @@ -0,0 +1,7 @@ +--- +# You don't need to edit this file, it's empty on purpose. +# Edit theme's home layout instead if you wanna make some changes +# See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults +layout: blog +--- + diff --git a/ci/build.sh b/ci/build.sh new file mode 100755 index 0000000..225ca92 --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,38 @@ +#!/bin/sh +set -ex + +mkdir -p repos + +if [ ! -d repos/wasm-bindgen ]; then + git clone https://github.com/rustwasm/wasm-bindgen repos/wasm-bindgen +fi +if [ ! -d repos/wasm-pack ]; then + git clone https://github.com/rustwasm/wasm-pack repos/wasm-pack +fi +if [ ! -d repos/book ]; then + git clone https://github.com/rustwasm/book repos/book +fi + +wasm_bindgen_tag=$(cd repos/wasm-bindgen && git describe --abbrev=0 --tags) +wasm_pack_tag=$(cd repos/wasm-pack && git describe --abbrev=0 --tags) + +(cd repos/wasm-bindgen && git reset --hard $wasm_bindgen_tag) +(cd repos/wasm-pack && git reset --hard $wasm_pack_tag) + +wasm_pack_publish_date=$(date -d "@$(cd repos/wasm-pack && git show -s --format=%at)" "+%b %e") + +echo "wasm-pack-tag: $wasm_pack_tag" >> _build.yml +echo "wasm-pack-publish-date: $wasm_pack_publish_date" >> _build.yml + +bundler exec jekyll build --config _config.yml,_build.yml + +mkdir -p _site/docs +mdbook build repos/wasm-bindgen/guide +mv repos/wasm-bindgen/guide/book _site/docs/wasm-bindgen + +mdbook build repos/wasm-pack/docs +mv repos/wasm-pack/docs/book _site/docs/wasm-pack + +mdbook build repos/book +mv repos/book/book _site/docs/book + diff --git a/docs.md b/docs.md new file mode 100644 index 0000000..19f83cc --- /dev/null +++ b/docs.md @@ -0,0 +1,3 @@ +* [The rustwasm book](docs/book) +* [The wasm-bindgen book](docs/wasm-bindgen) +* [The wasm-pack book](docs/wasm-pack) diff --git a/index.md b/index.md index 1eb5d67..3014d92 100644 --- a/index.md +++ b/index.md @@ -4,3 +4,12 @@ # See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults layout: home --- + +
+ ✨ Install wasm-pack 0.6.0 ✨ +

{{ site.wasm-pack-publish-date }} | + + Release Notes + +

+
From 416ef7c7c4edd2ad413dec8cb0e370507915f724 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 23 Jan 2019 08:54:31 -0800 Subject: [PATCH 2/6] Remove dedicated blog page, put back on main --- _includes/header.html | 2 +- _layouts/blog.html | 28 ---------------------------- _layouts/home.html | 24 ++++++++++++++++++++++++ blog.md | 7 ------- 4 files changed, 25 insertions(+), 36 deletions(-) delete mode 100644 _layouts/blog.html delete mode 100644 blog.md diff --git a/_includes/header.html b/_includes/header.html index 4f84592..7b2bffc 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -23,7 +23,7 @@
📚 Learn - 📖 Blog + 📖 Blog 👯 Get Involved {%- for path in page_paths -%} {%- assign my_page = site.pages | where: "path", path | first -%} diff --git a/_layouts/blog.html b/_layouts/blog.html deleted file mode 100644 index 3937c61..0000000 --- a/_layouts/blog.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: default ---- -{{ content }} - -{%- if site.posts.size > 0 -%} -
-

{{ page.list_title | default: "Blog Posts" }}

-
    - {%- for post in site.posts -%} -
  • - {%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%} - -

    - - {{ post.title | escape }} - -

    - {%- if site.show_excerpts -%} - {{ post.excerpt }} - {%- endif -%} -
  • - {%- endfor -%} -
- -

subscribe via RSS

-
-{%- endif -%} diff --git a/_layouts/home.html b/_layouts/home.html index 57b4a0a..61b72c1 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -24,4 +24,28 @@

Get Involved

{{ content }} + + {%- if site.posts.size > 0 -%} +
+

{{ page.list_title | default: "Blog Posts" }}

+
    + {%- for post in site.posts -%} +
  • + {%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%} + +

    + + {{ post.title | escape }} + +

    + {%- if site.show_excerpts -%} + {{ post.excerpt }} + {%- endif -%} +
  • + {%- endfor -%} +
+ +

subscribe via RSS

+
+ {%- endif -%}
diff --git a/blog.md b/blog.md deleted file mode 100644 index 0eb25d7..0000000 --- a/blog.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -# You don't need to edit this file, it's empty on purpose. -# Edit theme's home layout instead if you wanna make some changes -# See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults -layout: blog ---- - From 78d9ceac0edc8eccd0f0a6d56a79366642513e6c Mon Sep 17 00:00:00 2001 From: DebugSteven Date: Fri, 1 Mar 2019 17:31:44 -0700 Subject: [PATCH 3/6] create a descriptive bookshelf for rust wasm resources --- docs.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/docs.md b/docs.md index 19f83cc..00dcea1 100644 --- a/docs.md +++ b/docs.md @@ -1,3 +1,81 @@ -* [The rustwasm book](docs/book) -* [The wasm-bindgen book](docs/wasm-bindgen) -* [The wasm-pack book](docs/wasm-pack) +% Rust and WebAssembly Documentation + + + +Welcome to an overview of the documentation provided by the [Rust +WebAssembly Working Group](https://github.com/rustwasm). All of these +projects are managed by the working group; there are other unofficial +documentation resources as well! + +Many of these resources take the form of "books"; we collectively call +these "The Rust WebAssembly Bookshelf." Some are large, some are small. + +# Learn about Rust and WebAssembly + +If you'd like to learn about Rust and WebAssembly, this is the spot for +you! All of these resources assume that you have programmed a little bit +of Rust and that you have some familiarity with JavaScript. If you want +to learn how to use Rust in your web browser, these resources are a +great place to get started: + +## The Rust Wasm Book + +[The Rust Wasm Book](docs/book) describes how to use Rust and +WebAssembly together. There's a tutorial to create an end to end project +using Rust and WebAssembly and finally the book concludes with reference +sections full of general, good to know, information, to explore more +with Rust and WebAssembly. + +# Dive Into Rust and WebAssembly + +If you'd like a deeper dive into Rust and WebAssembly, these resources +are for you. These books are good to look into after you've gone through +the tutorial in [The Rust Wasm Book](docs/book) or you already have some +familiarity with Rust, WebAssembly, and JavaScript. These books go into +more depth about the Rust WebAssesmbly tools and crates. + +## The `wasm-bindgen` Guide + +[The `wasm-bindgen` Guide](docs/wasm-bindgen) covers the `wasm-bindgen` +tool and crate. `wasm-bindgen` is a Rust library and CLI tool that +facilitate high-level interactions between wasm modules and JavaScript. +This is great to read if you're seeking more information about how +`wasm-bindgen` works, what more you can do with it, and other references +for the `wasm-bindgen` tool and related crates. There's also information +on how you can contribute to the `wasm-bindgen` tool, if you're +curious. + +## The `wasm-pack` Book + +[The `wasm-pack` Book](docs/wasm-pack) covers the Rust to WebAssembly +workflow tool. This book covers prerequistes, project setup, and +available commands for `wasm-pack`. The `wasm-pack` book has quick start +guides to using generated templates and highlights how the workflow with +those templates works so you can get a working Rust and WebAssembly +project up, running, and deployed fast. If you're interested in +contributing to `wasm-pack`, you will find all that information at the +end of this book too! From a4c9d5c089de44f971885df2d47cb20136c661f3 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 5 Mar 2019 20:19:20 -0700 Subject: [PATCH 4/6] Update docs.md Co-Authored-By: DebugSteven --- docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs.md b/docs.md index 00dcea1..cb04b7c 100644 --- a/docs.md +++ b/docs.md @@ -47,7 +47,7 @@ great place to get started: [The Rust Wasm Book](docs/book) describes how to use Rust and WebAssembly together. There's a tutorial to create an end to end project using Rust and WebAssembly and finally the book concludes with reference -sections full of general, good to know, information, to explore more +sections full of general, good-to-know information to explore more with Rust and WebAssembly. # Dive Into Rust and WebAssembly From af19898c8e912f30e6bc28f68251d5c3c7e66ba7 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 5 Mar 2019 20:19:27 -0700 Subject: [PATCH 5/6] Update docs.md Co-Authored-By: DebugSteven --- docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs.md b/docs.md index cb04b7c..fd37179 100644 --- a/docs.md +++ b/docs.md @@ -32,7 +32,7 @@ projects are managed by the working group; there are other unofficial documentation resources as well! Many of these resources take the form of "books"; we collectively call -these "The Rust WebAssembly Bookshelf." Some are large, some are small. +these "The Rust and WebAssembly Bookshelf." Some are large, some are small. # Learn about Rust and WebAssembly From 7937db0143f482f5e7eb53d60fbe8ee9e277da63 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 5 Mar 2019 20:19:35 -0700 Subject: [PATCH 6/6] Update docs.md Co-Authored-By: DebugSteven --- docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs.md b/docs.md index fd37179..8e9d6bc 100644 --- a/docs.md +++ b/docs.md @@ -27,7 +27,7 @@ h2 { Welcome to an overview of the documentation provided by the [Rust -WebAssembly Working Group](https://github.com/rustwasm). All of these +and WebAssembly Working Group](https://github.com/rustwasm). All of these projects are managed by the working group; there are other unofficial documentation resources as well!