-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #85876 - jeanlucthumm:master, r=GuillaumeGomez
Add `go_to_first` query param to jump to first result Fixes #84214 Note that while the issue initially wanted to navigate to an entry on exact match, the discussion settled on using a query parameter (`&go_to_first=true`) instead, regardless of exact or partial match. Demonstration is attached https://user-images.githubusercontent.com/4934853/120258768-7ff28980-c247-11eb-8c8f-1a2ceb242788.mp4
- Loading branch information
Showing
3 changed files
with
30 additions
and
4 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. |
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