Skip to content

Add a "nightly only" warning to documentation #1329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@ 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)
- [wasm-bindgen-futures](https://docs.rs/wasm-bindgen-futures)

## License

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 44 additions & 0 deletions guide/_theme/header.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<style>
header.warning {
background-color: rgb(242, 222, 222);
border-bottom-color: rgb(238, 211, 215);
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-style: solid;
border-bottom-width: 0.666667px;
border-image-outset: 0 0 0 0;
border-image-repeat: stretch stretch;
border-image-slice: 100% 100% 100% 100%;
border-image-source: none;
border-image-width: 1 1 1 1;
border-left-color: rgb(238, 211, 215);
border-left-style: solid;
border-left-width: 0.666667px;
border-right-color: rgb(238, 211, 215);
border-right-style: solid;
border-right-width: 0.666667px;
border-top-color: rgb(238, 211, 215);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-top-style: solid;
border-top-width: 0.666667px;
color: rgb(185, 74, 72);
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 30px;
padding-bottom: 8px;
padding-left: 14px;
padding-right: 35px;
padding-top: 8px;
text-align: center;
}
</style>
<header class='warning'>
This is the <strong>unpublished</strong> documentation of
<code>wasm-bindgen</code>, the published documentation is available
<a href="https://rustwasm.github.io/docs/wasm-bindgen/">
on the main Rust and WebAssembly documentation site
</a>. Features documented here may not be available in released versions of
<code>wasm-bindgen</code>.
</header>
8 changes: 5 additions & 3 deletions guide/src/contributing/index.md
Original file line number Diff line number Diff line change
@@ -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
```

Expand Down
4 changes: 2 additions & 2 deletions guide/src/contributing/js-sys/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions guide/src/contributing/web-sys/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/