-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Description
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.
- If you have a copy of the old site, we could use
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
- Edit distance between URLs
http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance
- Site Search
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’]