Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request rustwasm#514 from drager/docs-fixes
Browse files Browse the repository at this point in the history
doc: Fix links and Rust highlightning
  • Loading branch information
ashleygwilliams authored Jan 19, 2019
2 parents c8410f2 + 6fc3f9b commit dbc5a36
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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).

0 comments on commit dbc5a36

Please sign in to comment.