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

Doc 18498 #18528

Merged
merged 3 commits into from
Nov 4, 2014
Merged

Doc 18498 #18528

merged 3 commits into from
Nov 4, 2014

Conversation

seanjensengrey
Copy link
Contributor

This addresses #18498 by adding a prepopulated search box to do site search on doc.rust-lang.org using duckduckgo AND generating a search url against the rust documentation using the internal search facilities.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

@seanjensengrey
Copy link
Contributor Author

Drop this server.py into /doc for testing the 404 page

https://gist.github.com/seanjensengrey/0f5545be4f1c8562d126

And load

http://localhost:8080/core/option/type.Option.html#method.unwrap_or_else

you should see

screen shot 2014-11-02 at 8 15 28 am

@huonw
Copy link
Member

huonw commented Nov 2, 2014

It is good to see progress on this, and it is definitely an improvement over what we have now. The best-case would be having it use the rustdoc search infrastructure to get the feedback right on the page, e.g. "opiton".

@@ -11,9 +11,33 @@ Looks like you've taken a wrong turn.

Some things that might be helpful to you though:

## Search
* <form action="https://duckduckgo.com/">
<input type="text" id="code.search" name="q" size="80"></input>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think . is a good character to have in an ID (conflicts with the class selector in CSS), conventionally this one might use code-search.

@huonw
Copy link
Member

huonw commented Nov 2, 2014

The heuristic implemented here doesn't appear to handle links like the following very well:

  • .../std/opiton/
  • .../std/opiton/index.html

I do not think this should block landing this pull request, since it is a helpful feature (not core to the functionality of the language or the docs) and this can easily be improved over time.

@seanjensengrey
Copy link
Contributor Author

Agree that we could have more heuristics, also certain paths could get decomposed and rewritten as

http://doc.rust-lang.org/core/?search=unwrap_or_else
http://doc.rust-lang.org/std/?search=io

Search functionality uses both duckduckgo for site wide doc search
and the rust specific documentation search @

http://doc.rust-lang.org/core/?search=unwrap_or_else
@seanjensengrey
Copy link
Contributor Author

I updated the commit to rename the ID as well as add a second link to the rust documentation search tool. See the screenshot above.

bors added a commit that referenced this pull request Nov 4, 2014
This addresses #18498 by adding a prepopulated search box to do site search on `doc.rust-lang.org` using duckduckgo AND generating a search url against the rust documentation using the internal search facilities.

* https://duckduckgo.com/?q=type+Option+unwrap_or_else+site%3Adoc.rust-lang.org
* http://doc.rust-lang.org/core/?search=unwrap_or_else
@bors bors closed this Nov 4, 2014
@bors bors merged commit eca7ab5 into rust-lang:master Nov 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants