Skip to content
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

Merged
merged 1 commit into from
Dec 6, 2018

Conversation

GuillaumeGomez
Copy link
Member

Fixes #55531.

Look:

screenshot 2018-11-01 at 02 21 56

r? @QuietMisdreavus

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 1, 2018
@@ -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 ' +
Copy link
Member

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).

Copy link
Contributor

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.

@varkor
Copy link
Member

varkor commented Nov 1, 2018

Maybe it's worth being even more explicit:

Or try looking in one of these:
- The [Rust Reference] for technical details about the language.
- [Rust by Example] for expository code examples.
- The [Rust Book] for introductions to language features and the language itself.

Just in case the reader isn't familiar with them already (there's enough spare room).

@QuietMisdreavus
Copy link
Member

QuietMisdreavus commented Nov 2, 2018

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.

@GuillaumeGomez
Copy link
Member Author

Way better indeed! I'll use @varkor's suggestion.

@GuillaumeGomez
Copy link
Member Author

New look:

screenshot 2018-11-04 at 13 04 56

@QuietMisdreavus
Copy link
Member

Looks good to me! @varkor @memoryruins, what do y'all think?

@memoryruins
Copy link
Contributor

memoryruins commented Nov 5, 2018

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?

no_result

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

- [Docs.rs] for documentation of crates released on crates.io

Some rust-nursery crates are nearly std and it could be helpful to specify the origin of the generated docs.

'</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.' +
Copy link
Member

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.

@varkor
Copy link
Member

varkor commented Nov 6, 2018

Looks good to me!

@QuietMisdreavus
Copy link
Member

+1 to @memoryruins' wording suggestion.

@TimNN TimNN added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 20, 2018
@GuillaumeGomez
Copy link
Member Author

Updated the wording.

@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 26, 2018
Copy link
Member

@QuietMisdreavus QuietMisdreavus left a 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.

@QuietMisdreavus
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 3, 2018

📌 Commit c209ed8 has been approved by QuietMisdreavus

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 3, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Dec 4, 2018
… 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
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 4, 2018
… 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
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 5, 2018
… 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
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Dec 5, 2018
… 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
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Dec 5, 2018
… 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
bors added a commit that referenced this pull request Dec 5, 2018
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
@bors bors merged commit c209ed8 into rust-lang:master Dec 6, 2018
@GuillaumeGomez GuillaumeGomez deleted the doc-search-sentence branch December 6, 2018 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants