Skip to content

Commit 867a360

Browse files
committed
Add Website features page to rustdoc book
1 parent e2635ee commit 867a360

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/doc/rustdoc/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
- [Lints](lints.md)
1111
- [Advanced features](advanced-features.md)
1212
- [Unstable features](unstable-features.md)
13+
- [Website features](website-features.md)
1314
- [Passes](passes.md)
1415
- [References](references.md)
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Website features
2+
3+
These features are about using the website generated by `rustdoc`.
4+
5+
## Custom search engines
6+
7+
If you find yourself often referencing online Rust docs you might enjoy using a custom search
8+
engine. This allows you to use the navigation bar directly to search a `rustdoc` website.
9+
Most browsers support this feature by letting you define a URL template containing `%s`
10+
which will be substituted for the search term. As an example, for the standard library you could use
11+
this template:
12+
```
13+
https://doc.rust-lang.org/stable/std/?search=%s
14+
```
15+
Note that this will take you to a results page listing all matches. If you want to navigate to the first
16+
result right away (which is often the best match) use the following instead:
17+
```
18+
https://doc.rust-lang.org/stable/std/?search=%s&go_to_first=true
19+
```
20+
This URL adds the `go_to_first=true` query parameter which can be appended to any `rustdoc` search URL
21+
to automatically go to the first result.

0 commit comments

Comments
 (0)