-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Website features page to rustdoc book
- Loading branch information
1 parent
68e3c49
commit 6c5c0a5
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 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: | ||
|
||
```text | ||
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: | ||
|
||
```text | ||
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. |