-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve no result found sentence in doc search #55563
Conversation
src/librustdoc/html/static/main.js
Outdated
@@ -1340,7 +1340,13 @@ | |||
output = '<div class="search-failed"' + extraStyle + '>No results :(<br/>' + | |||
'Try on <a href="https://duckduckgo.com/?q=' + | |||
encodeURIComponent('rust ' + query.query) + | |||
'">DuckDuckGo</a>?</div>'; | |||
'">DuckDuckGo</a>?<br/><br/>' + | |||
'Or maybe you want to take a look to the <a ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Take a look at" or "Look in" sounds more natural here (and in "or to" below).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When doc searches are in other crates and not std, the "or maybe you want" might not apply as often. The following is a plain option that links to the full Rust Documentation page for providing descriptions and additional resources:
Rust Documentation provides additional resources and guides, such as the Rust Book, Rust by Example, and the Rust Reference.
Maybe it's worth being even more explicit:
Just in case the reader isn't familiar with them already (there's enough spare room). |
If this is going to be in every doc build and not just std (as it is right now), then i'm wary about this. Imagine you're looking for something in hyper's docs and get linked to std. If we're going to link to all of these things, I like @varkor's suggestion, but we could also include a link to docs.rs, such as: - [Docs.rs] for documentation on third-party crates. |
Way better indeed! I'll use @varkor's suggestion. |
737f5af
to
461e4be
Compare
Looks good to me! @varkor @memoryruins, what do y'all think? |
I like it :) the links will be useful! Since the new list looks best left-aligned yet is logically grouped with the "result not found" text, thoughts on left-aligning everything altogether? The left side is where my eyes already go when expecting a result, and it keeps the groups alignment consistent. Instead of using the term "third-party" on the Docs.rs description, should we say
Some rust-nursery crates are nearly std and it could be helpful to specify the origin of the generated docs. |
src/librustdoc/html/static/main.js
Outdated
'</a> for expository code examples.</a></li><li>The <a ' + | ||
'href="https://doc.rust-lang.org/book/index.html">Rust Book</a> for ' + | ||
'introductions to language features and the language itself.</li><li><a ' + | ||
'href="https://docs.rs">Docs.rs</a> for documentation on third-party crates.' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps documentation of third-party crates.
Looks good to me! |
+1 to @memoryruins' wording suggestion. |
461e4be
to
c209ed8
Compare
Updated the wording. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much! This looks good to me.
@bors r+ rollup |
📌 Commit c209ed8 has been approved by |
… r=QuietMisdreavus Improve no result found sentence in doc search Fixes rust-lang#55531. Look: <img width="1440" alt="screenshot 2018-11-01 at 02 21 56" src="https://user-images.githubusercontent.com/3050060/47827257-f6236c80-dd7c-11e8-9ea9-99c8cb4b2de5.png"> r? @QuietMisdreavus
… r=QuietMisdreavus Improve no result found sentence in doc search Fixes rust-lang#55531. Look: <img width="1440" alt="screenshot 2018-11-01 at 02 21 56" src="https://user-images.githubusercontent.com/3050060/47827257-f6236c80-dd7c-11e8-9ea9-99c8cb4b2de5.png"> r? @QuietMisdreavus
… r=QuietMisdreavus Improve no result found sentence in doc search Fixes rust-lang#55531. Look: <img width="1440" alt="screenshot 2018-11-01 at 02 21 56" src="https://user-images.githubusercontent.com/3050060/47827257-f6236c80-dd7c-11e8-9ea9-99c8cb4b2de5.png"> r? @QuietMisdreavus
… r=QuietMisdreavus Improve no result found sentence in doc search Fixes rust-lang#55531. Look: <img width="1440" alt="screenshot 2018-11-01 at 02 21 56" src="https://user-images.githubusercontent.com/3050060/47827257-f6236c80-dd7c-11e8-9ea9-99c8cb4b2de5.png"> r? @QuietMisdreavus
… r=QuietMisdreavus Improve no result found sentence in doc search Fixes rust-lang#55531. Look: <img width="1440" alt="screenshot 2018-11-01 at 02 21 56" src="https://user-images.githubusercontent.com/3050060/47827257-f6236c80-dd7c-11e8-9ea9-99c8cb4b2de5.png"> r? @QuietMisdreavus
Rollup of 15 pull requests Successful merges: - #51753 (Document `From` implementations) - #55563 (Improve no result found sentence in doc search) - #55987 (Add Weak.ptr_eq) - #56119 (Utilize `?` instead of `return None`.) - #56372 (Refer to the second borrow as the "second borrow" in E0501.rs) - #56388 (More MIR borrow check cleanup) - #56424 (Mention raw-ident syntax) - #56452 (Remove redundant clones) - #56456 (Handle existential types in dead code analysis) - #56466 (data_structures: remove tuple_slice) - #56476 (Fix invalid line number match) - #56497 (cleanup: remove static lifetimes from consts in libstd) - #56498 (Fix line numbers display) - #56523 (Added a bare-bones eslint config (removing jslint)) - #56538 (Use inner iterator may_have_side_effect for Cloned) Failed merges: r? @ghost
Fixes #55531.
Look:
r? @QuietMisdreavus