From 96f4c8aa6396db41e0c0fa4d3eee3e94fc1b9e9b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 7 Mar 2019 07:42:47 -0800 Subject: [PATCH] Add a "nightly only" warning to documentation Official documentation is now available at https://rustwasm.github.io/docs/wasm-bindgen/, so let's leave this git repository's documentation purely for our own previewing purposes. --- Cargo.toml | 2 +- README.md | 11 ++++--- azure-pipelines.yml | 2 +- guide/_theme/header.hbs | 44 +++++++++++++++++++++++++ guide/src/contributing/index.md | 8 +++-- guide/src/contributing/js-sys/index.md | 4 +-- guide/src/contributing/web-sys/index.md | 7 ++++ 7 files changed, 67 insertions(+), 11 deletions(-) create mode 100644 guide/_theme/header.hbs diff --git a/Cargo.toml b/Cargo.toml index 4215164e..902e1b95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ links = "wasm_bindgen" readme = "README.md" categories = ["wasm"] repository = "https://github.com/rustwasm/wasm-bindgen" -homepage = "https://rustwasm.github.io/wasm-bindgen/" +homepage = "https://rustwasm.github.io/" documentation = "https://docs.rs/wasm-bindgen" description = """ Easy support for interacting between JS and Rust. diff --git a/README.md b/README.md index 915a4e28..5a3a39fc 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,16 @@ greet("World!"); ## Guide -[**📚 Read the `wasm-bindgen` guide here! 📚**](https://rustwasm.github.io/wasm-bindgen) +[**📚 Read the `wasm-bindgen` guide here! 📚**](https://rustwasm.github.io/docs/wasm-bindgen/) + +You can find general documentation about Rust and WebAssembly +[here](https://rustwasm.github.io/docs). ## API Docs -- [wasm-bindgen](https://rustwasm.github.io/wasm-bindgen/api/wasm_bindgen/) -- [js-sys](https://rustwasm.github.io/wasm-bindgen/api/js_sys/) -- [web-sys](https://rustwasm.github.io/wasm-bindgen/api/web_sys/) +- [wasm-bindgen](https://docs.rs/wasm-bindgen) +- [js-sys](https://docs.rs/js-sys) +- [web-sys](https://docs.rs/web-sys) ## License diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0647de6e..fbc8af42 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -236,7 +236,7 @@ jobs: 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 - -C $HOME/mdbook echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/mdbook" displayName: "Install mdbook" - - script: (cd guide && mdbook build) + - script: (cd guide && mv _theme theme && mdbook build) - task: PublishPipelineArtifact@0 inputs: artifactName: doc_book diff --git a/guide/_theme/header.hbs b/guide/_theme/header.hbs new file mode 100644 index 00000000..00172d7c --- /dev/null +++ b/guide/_theme/header.hbs @@ -0,0 +1,44 @@ + +
+ This is the unpublished documentation of + wasm-bindgen, the published documentation is available + + on the main Rust and WebAssembly documentation site + . Features documented here may not be available in released versions of + wasm-bindgen. +
diff --git a/guide/src/contributing/index.md b/guide/src/contributing/index.md index 78f37e8e..fb848001 100644 --- a/guide/src/contributing/index.md +++ b/guide/src/contributing/index.md @@ -1,14 +1,16 @@ # Contributing to `wasm-bindgen` This section contains instructions on how to get this project up and running for -development. +development. You may want to browse the [unpublished guide documentation] for +`wasm-bindgen` as well as it may have more up-to-date information. + +[unpublished documentation]: https://rustwasm.github.io/wasm-bindgen/ ## Prerequisites -1. Rust Nightly. [Install Rust]. Once Rust is installed, run +1. Rust.[Install Rust]. Once Rust is installed, run ```shell - rustup default nightly rustup target add wasm32-unknown-unknown ``` diff --git a/guide/src/contributing/js-sys/index.md b/guide/src/contributing/js-sys/index.md index 28658b21..aa5ff5cd 100644 --- a/guide/src/contributing/js-sys/index.md +++ b/guide/src/contributing/js-sys/index.md @@ -6,8 +6,8 @@ and its source lives at [`wasm-bindgen/crates/js-sys`][src]. With the `js-sys` crate, we can work with `Object`s, `Array`s, `Function`s, `Map`s, `Set`s, etc... without writing the `#[wasm_bindgen]` imports by hand. -Documentation for this crate will eventually be available on [docs.rs][docsrs] -but temporarily you can also check out the [master branch +Documentation for the published version of this crate is available on +[docs.rs][docsrs] but you can also check out the [master branch documentation][masterdoc] for the crate. [docsrs]: https://docs.rs/js-sys diff --git a/guide/src/contributing/web-sys/index.md b/guide/src/contributing/web-sys/index.md index 1b6d5155..f94633f9 100644 --- a/guide/src/contributing/web-sys/index.md +++ b/guide/src/contributing/web-sys/index.md @@ -8,3 +8,10 @@ using `wasm-bindgen`'s WebIDL frontend and the WebIDL interface definitions for Web APIs. This means that `web-sys` isn't always the most ergonomic crate to use, but it's intended to provide verified and correct bindings to the web platform, and then better interfaces can be iterated on crates.io! + +Documentation for the published version of this crate is available on +[docs.rs][docsrs] but you can also check out the [master branch +documentation][masterdoc] for the crate. + +[docsrs]: https://docs.rs/web-sys +[masterdoc]: https://rustwasm.github.io/wasm-bindgen/api/js_sys/