-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Make docs search results URL-addressable #11760
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
Conversation
This is pretty awesome! It's been awhile since I've used web js stuff, but is |
This is awesome! 🌟 |
@alexcrichton This might be of help: http://html5please.com/#history Side note: we don't support polyfill for HTML5 elements so we're requesting a fairly recent browser already. |
polyfill? I was unaware of that? It sounds like history may not be ready for full-out usage though, so could you add a |
@alexcrichton HTML5shiv is an HTML5 polyfill for IE up to version 8. I'm not fan of using that kind of thing through, right now we display for IE up to 8:
...which will encourage people to upgrade their browser instead of staying with an old and dodgy thing being a pain for web devs. |
I'm getting lost here, I have no idea what polyfill is? I'm just thinking that if you have a slightly older browser it'd be better to be able to still search, right? Should we not have an if-check around dealing with the history state? |
This change adds two improvements to docs searching functionality. First, search results will immediately be displayed when a ?search=searchterm query string parameter is provided to any docs url. Second, search results are now inserted into the browser history, allowing for easier navigation between search results and docs pages.
@alexcrichton I agree that we should have that check. I was just saying that generally we already require a fairly recent browser supporting HTML5 to display the page itself (that being said, js.history support remains unclear right now). |
Yes, checking for the history API is quite easy; I've added that gate. Note that it only gates the second improvement; the first improvement (searching directly from a URL with ?search=searchterm) is still available for all. |
This change adds two improvements to docs searching functionality. First, search results will immediately be displayed when a ?search=searchterm query string parameter is provided to any docs url. Second, search results are now inserted into the browser history, allowing for easier navigation between search results and docs pages.
Don't check for late-bound vars, check for escaping bound vars Fixes an assertion that didn't make sense. Many valid and well-formed types *have* late-bound vars (e.g. `for<'a> fn(&'a ())`), they just must not have *escaping* late-bound vars in order to be normalized correctly. Addresses rust-lang/rust-clippy#11230, cc `@jyn514` and `@matthiaskrgr` changelog: don't check for late-bound vars, check for escaping bound vars. Addresses rust-lang/rust-clippy#11230
Don't check for late-bound vars, check for escaping bound vars Fixes an assertion that didn't make sense. Many valid and well-formed types *have* late-bound vars (e.g. `for<'a> fn(&'a ())`), they just must not have *escaping* late-bound vars in order to be normalized correctly. Addresses rust-lang/rust-clippy#11230, cc `@jyn514` and `@matthiaskrgr` changelog: don't check for late-bound vars, check for escaping bound vars. Addresses rust-lang/rust-clippy#11230
Don't check for late-bound vars, check for escaping bound vars Fixes an assertion that didn't make sense. Many valid and well-formed types *have* late-bound vars (e.g. `for<'a> fn(&'a ())`), they just must not have *escaping* late-bound vars in order to be normalized correctly. Addresses rust-lang/rust-clippy#11230, cc `@jyn514` and `@matthiaskrgr` changelog: don't check for late-bound vars, check for escaping bound vars. Addresses rust-lang/rust-clippy#11230
Don't check for late-bound vars, check for escaping bound vars Fixes an assertion that didn't make sense. Many valid and well-formed types *have* late-bound vars (e.g. `for<'a> fn(&'a ())`), they just must not have *escaping* late-bound vars in order to be normalized correctly. Addresses rust-lang/rust-clippy#11230, cc `@jyn514` and `@matthiaskrgr` changelog: don't check for late-bound vars, check for escaping bound vars. Addresses rust-lang/rust-clippy#11230
Don't check for late-bound vars, check for escaping bound vars Fixes an assertion that didn't make sense. Many valid and well-formed types *have* late-bound vars (e.g. `for<'a> fn(&'a ())`), they just must not have *escaping* late-bound vars in order to be normalized correctly. Addresses rust-lang/rust-clippy#11230, cc `@jyn514` and `@matthiaskrgr` changelog: don't check for late-bound vars, check for escaping bound vars. Addresses rust-lang/rust-clippy#11230
This change adds two improvements to docs searching functionality.
First, search results will immediately be displayed when a ?search=searchterm
query string parameter is provided to any docs url.
Second, search results are now inserted into the browser history, allowing for
easier navigation between search results and docs pages.