Skip to content

Commit

Permalink
Add Website features page to rustdoc book
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlucthumm committed Jun 25, 2021
1 parent e2635ee commit 867a360
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/doc/rustdoc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
- [Lints](lints.md)
- [Advanced features](advanced-features.md)
- [Unstable features](unstable-features.md)
- [Website features](website-features.md)
- [Passes](passes.md)
- [References](references.md)
21 changes: 21 additions & 0 deletions src/doc/rustdoc/src/website-features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Website features

These features are about using the website generated by `rustdoc`.

## Custom search engines

If you find yourself often referencing online Rust docs you might enjoy using a custom search
engine. This allows you to use the navigation bar directly to search a `rustdoc` website.
Most browsers support this feature by letting you define a URL template containing `%s`
which will be substituted for the search term. As an example, for the standard library you could use
this template:
```
https://doc.rust-lang.org/stable/std/?search=%s
```
Note that this will take you to a results page listing all matches. If you want to navigate to the first
result right away (which is often the best match) use the following instead:
```
https://doc.rust-lang.org/stable/std/?search=%s&go_to_first=true
```
This URL adds the `go_to_first=true` query parameter which can be appended to any `rustdoc` search URL
to automatically go to the first result.

0 comments on commit 867a360

Please sign in to comment.