-
Notifications
You must be signed in to change notification settings - Fork 916
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
Support direct links to options on Configuration documentation site #4261
Comments
After reading about this issue and wanting to work on it I find that by clicking on the link https://rust-lang.github.io/rustfmt/#reorder_modules the configuration options are being filtered by the hash text. So the link essentially fills in the search bar with So in a way this is already supported but instead of a direct link the hash term is used for search. |
@aszenz Was looking into this as well. That is really wonky, it does not even filter out the first 2 sections... |
@hbina That seems deliberate the first two sections are headers and the search only applies to the configuration options, the searchTerm is filled in from the url hash as well |
Yup, the current search is more of a filter/show all options that include the needle text within their section. This is particularly noticeable for common items (try using |
Yes and is it something that should be changed, I do see it as being less useful than direct linking. |
I see these as orthogonal, and don't want to minimize either. It's entirely valid that a user may want to narrow down the page content to a specific area they are interested in at that moment (for example "show me all the options that impact |
Yes that's what search is for, but using the url hash for search is a bit unorthodox, usually its done using a query parameter like |
@aszenz - My point is that both search/filter and direct linking/navigation are equally useful and that we need to support both. I'm entirely open to any solution that delivers both, including any that changes the current uri search behavior. We just can't go with an approach that provides direct linking/navigation but removes search/filter entirely. |
I agree with @calebcartwright, both should be supported. The search term is better as a query param, and linking to the header of an option with a url hash is easy, the markdown renderer just needs to be given a function to render the header with an |
AFAIK our Configuration documentation site doesn't support direct links to configuration options. It'd be great to be able to do so like we can with the in-repo markdown file.
Works 👉 https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#reorder_modules
Doesn't work 👉 https://rust-lang.github.io/rustfmt/#reorder_modules
I suspect the solution for this will end up being closely related to #4260, though opening as a separate issue in case it can be solved more quickly/independently.
Also refs #4178 and #4221
The text was updated successfully, but these errors were encountered: