Skip to content
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

doc: Fix links and Rust highlightning #514

Merged
merged 1 commit into from
Jan 19, 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
4 changes: 2 additions & 2 deletions docs/src/prerequisites/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

To run `wasm-pack` you'll need to have both Rust and npm installed and configured.

- [Rust](./rust.html)
- [npm](./npm.html)
- [Rust](./prerequisites/rust.html)
- [npm](./prerequisites/npm.html)

In the future, we intend to rewrite the npm registry client bits so that the need
for a Node runtime is eliminated. If you're excited about that work- you should
Expand Down
4 changes: 2 additions & 2 deletions docs/src/tutorial/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Be sure to have done the following before starting:
1. [Install `wasm-pack`](../../installer)
1. Read and install the [Prerequisites](../prerequisites/index.html).

- You'll need [Rust], version 1.30 or higher. (Currently either `beta` or `nightly` channels). [Learn more](../project-setup/rust.html).
- You'll need [Node.js] and [npm] installed. You'll also need an npm Account. [Learn more](../project-setup/npm.html).
- You'll need [Rust], version 1.30 or higher. (Currently either `beta` or `nightly` channels). [Learn more](../prerequisites/rust.html).
- You'll need [Node.js] and [npm] installed. You'll also need an npm Account. [Learn more](../prerequisites/npm.html).

⚠️ We strongly recommend that you install [Node.js] using a version manager. You can learn more [here](https://npmjs.com/get-npm).

Expand Down
10 changes: 5 additions & 5 deletions docs/src/tutorial/template-deep-dive/src-utils-rs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ We will discuss:

## 1. Defining `set_panic_hook`

```
```rust
use cfg_if::cfg_if;
```

This allows us to write `cfg_if!` instead of `cfg_if::cfg_if!`, identically to the line in `src/lib.rs`.

```
```rust
cfg_if! {
if #[cfg(feature = "console_error_panic_hook")] {
extern crate console_error_panic_hook;
Expand All @@ -35,14 +35,14 @@ As described in the preceding section, the macro `cfg_if!` evaluates the `if` st

The entire macro block will either be replaced with the statements in the `if` block or with those in the `else` block. These two cases are now described in turn:

```
```rust
extern crate console_error_panic_hook;
pub use self::console_error_panic_hook::set_once as set_panic_hook;
```

Due to the `use` statement, the function `self::console_error_panic_hook::set_once` can now be accessed more conveniently as `set_panic_hook`. Due to `pub`, this function will be publicly accessible outside of the `utils` module as `utils::set_panic_hook`.

```
```rust
#[inline]
pub fn set_panic_hook() {}
```
Expand All @@ -63,4 +63,4 @@ To do this, a panic hook for WebAssembly is provided that logs panics to the dev

Note that although the template sets up the function, your error messages will not automatically be enhanced. To enable the enhanced errors, call the function `utils::set_panic_hook()` in `lib.rs` when your code first runs. The function may be called multiple times if needed.

For more details, see the [`console_error_panic_hook` repository](https://github.com/rustwasm/console_error_panic_hook).
For more details, see the [`console_error_panic_hook` repository](https://github.com/rustwasm/console_error_panic_hook).