-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: Generate the documentation for one module on one page instead of several pages #9489
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
Comments
I talked with @Seldaek on IRC (he headed up the design of the new pages), and the conclusion we reached was that it's probably not so bad the way it is now. It's true that there are more clicks, but we do have a search bar and a sidebar navigation to find things. Basically, if it looks like the majority opinion is that it needs more content per page, then we should do that, otherwise it may be worth sticking to what exists (or at least this is my best summary). |
If we had documented every module completely on one page each, we could provide both functionalities: the current "jump to definition" and the suggested "glanze at everything at once". What would would be your reasons for moving the definitions back to separate pages? Page loading time? I think truly finding out what the majority perceives will be difficult (measuring samples and overcoming sampling bias). |
@kud1ing First of all I have to say that it is probably a very subjective thing, so I don't expect everyone to agree with me on this, and I don't expect I will be able to convince you, but I will try to explain my point of view at least. I recognize the small issue of navigating from item to item, sure it can be a bit easier to scroll through the whole page, but on the other hand if you want to get back to the list of links on top you also have to hit "back" in some form, so the benefit isn't so huge compared to individual pages. On the other hand, the benefits I see to individual pages are:
So all in all, I think between search and sidebar and type hyperlinks you have a lot more options to navigate easily and I find this superior to smashing everything on one page because navigation is hard. I just hope you'll give it a chance and hopefully see it's also a good model, but if ultimately most people dislike it we can obviously go back, it's not the hardest thing to change. |
I agree this is subjective. Discoverability suffers currently, which is important for people new to Rust, and i think this is not subjective. |
Maybe we can agree on providing both views:
|
Regarding the ascii example, in theory going to http://static.rust-lang.org/doc/master/std/ascii/struct.Ascii.html should list everything you can do with it. AsciiStr methods aren't listed for example, but that's a bug IMO. The AsciiStr page lists I was a newcomer recently and still am in many ways, but I found the long pages pretty awful for discoverability, I always got lost in the long lists of similar sounding functions and various impls. That's why I started working on the new docs, and put a focus on links & search which I think allow discoverability much more than "oh I found this by chance". If I want to find something I usually have a remote idea of how it could be called, but I don't necessarily know in which module it could be. |
I appreciate you hard work, thanks. |
BTW I'm not opposing it on principle, and ultimately I don't really have a final say in this anyway. I'd just like to give it some time and see because I feel it's something that is bound to trigger resistance when it changes but people will hopefully grow used to it (and maybe even like it). Maybe I'm wrong though :) As for the "can't we get both?", maybe. I just don't see how to make it happen sanely, but if someone has a concrete idea and can show a mockup (html or a piece of paper I don't mind) then I'd be happy to discuss it further. |
Today i tried to find out using http://static.rust-lang.org/doc/master/std/str/index.html whether |
@kud1ing this issue wouldn't actually fix that; it's mainly because of #10114 (since there's no page that lists all the traits that |
@huonw: Those need to be fixed for this special use case, i agree. In general, i find it unfortunate that one needs to know in advance how/where a functionality is implemented (which trait). I think doucmentation would be more usable when all functionality would be presented at once. |
Yes, that is exactly what #10114 covers, if that was implemented then This issue wouldn't actually fix the problems with built-in types, since a trait implementation is associated with the trait and the type, not the module in which it is implemented and so a page listing the entire contents of |
Visiting for triage. There is a related proposal over at discuss. |
This is quite an old bug at this point, and I believe that rustdoc's design has changed pretty radically in the interim, so I'm going to close for now. |
Browsing the documentation for functions/structs
foo
,bar
andbaz
currently involves a lot of clicks (click onfoo
, go back, click onbar
, go back, click onbaz
).Other language communities provide one documentation per module with "jumpable" links/anchors. Examples
The text was updated successfully, but these errors were encountered: