-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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.rust-lang.org should redirect to new on-topic page #18498
Comments
Is the doc.rust-lang.org site in VCS somewhere we could make the modifications ourselves? |
It is generated by rustdoc which is in the main repository |
Site search is just one solution. We could also redirect to the proper page automatically, #14572 was specifically about adding a search box. Originally I typed up this request before I found those two other issues. So a partial dupe? Looks like the source to that page is https://raw.githubusercontent.com/rust-lang/rust/master/src/doc/not_found.md Maybe @steveklabnik could point us in the direction of the 404 handler for the site? A pure JS solution in the meantime? |
I don't think automatic redirecting is a good solution. I think providing a list of possibilities is much better, which is exactly what an auto-filled search box will do. As with the normal doc search, this list of results can appear directly on the page, no user interaction necessary.
The site is static, that page is literally just served as a plain HTML page for each 404, so yes, JS is required, e.g. the search infrastructure from rustdoc. |
Another piece of useful infrastructure is documentation specific search http://doc.rust-lang.org/core/?search=unwrap_or_else adding this functionality to #18528 |
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
This fix is live. |
This addresses rust-lang/rust#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
Inbound links to doc.rust-lang.org end up at a landing page that is confusing. Other issues entered against it are #14572 and #18300
I’d like to redirect inbound links to rust documentation to the new stuff, ideally, I’d like to point ambiguous links to the correct(ish) location for all time.
For instance,
If I am reading this story (from 4 months ago)
http://www.reddit.com/r/rust/comments/29fecw/doeswill_rust_support_lazy_evaluation_of_function/
a comment points me to
http://doc.rust-lang.org/core/option/type.Option.html#method.unwrap_or_else
which drops me off at the new 404 landing page
really, I want to get to
http://doc.rust-lang.org/core/option/enum.Option.html
There are a couple fun options to solve this.
http://en.wikipedia.org/wiki/Tf%E2%80%93idf
http://en.wikipedia.org/wiki/Jaccard_index
Find the best set overlap between the old page and the new page, provide top n results to user
http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance
The other issues entered against this are #14572 and #18300 for search specifically as a solution.
Put a search box on that 404 page and populate with url fragments.
If put through google, "type Option unwrap_or_else site:doc.rust-lang.org”
the first link finds that page,
In [6]: [ t for t in "type.Option.html#method.unwrap_or_else".split(".") if '#' not in t ]
Out[6]: ['type', 'Option', 'unwrap_or_else’]
The text was updated successfully, but these errors were encountered: