-
Notifications
You must be signed in to change notification settings - Fork 9
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
Rustdoc 2019 roadmap planning #41
Comments
Currently unstable major featuresRustdoc has a handful of features that require nightly, either because they were introduced recently or their implementation is incomplete. Maybe we can try to push stabilization on some of these? I'm going to mention items i'd personally like to see stabilized before the end of next year, but there are probably other smaller ones we could add much more quickly.
|
TestingThere's an open PR right now that aims to add a new form of test for rustdoc: visual regression testing. This is meant to avert situations like rust-lang/rust#53262 where we lost type-kind colors in certain situations, but it can also detect things like items moving around on the page without us meaning it. With some extensions it could probably do more, but it's currently held up with needing to coordinate with T-infra to make sure the tests run in CI or bors. There's also the question of whether we even want to DIY this, or instead use a third-party service that's dedicated to this kind of testing. We could probably do with a concerted effort to make sure we're testing the right things on rustdoc, too. It would probably be best to come up with more/better ideas for tests to add to rustdoc (even if they require a new kind of test) for me to be willing to sign off on featuring an item like this. |
Just needs stabilization iirc.
Just like you said.
It's a bit more than that. At first, we should try to clean it up a bit because it's getting a bit messy (even more considering this is a new feature!). For the UI test PR, I talked about it with @simulcram. I explained to him our need and everything. The problem being that they don't have enough time to setup a server (I proposed to do it myself but didn't get answer on it so I guess they prefer to keep this in the infra team?).
We added a lot of new features lately. And a lot of them are still unstable. I think we should at least give a definitive opinion to a few of them instead of just keeping them this way. Another thing (linked to the previous one) I'd like to see is a global rustdoc cleanup (well, it has been started but having a global overview of it would be nice). The last thing I'd want: a real separation between rustdoc output generation and the code. It'd allow us to handle multiple output kinds (I think very strongly about markdown right now). None of these points is very difficult in itself, but they'd all take a lot of time. I think they're worth it though. |
It's a good idea to keep on top of this, we have similar issues in the Cargo team. Maybe a good idea to have regular stabilisation triage or something similar
+1 Keeping on top of technical debt is important
Similarly, I'd love to see Rustdoc towards more standard html generation (handlebars or something, I'm not really up to date on specific libraries here). It wouldn't need to change anything radical like we've previously discussed, but just separating code from presentation would enable people with a more web background to contribute more and allow us to iterate faster on presentation ideas. The other things on my mind for Rustdoc are using save-analysis for 'view source' (so we'd have something similar to cargo src or sourcegraph) and some kind of focused hacking on paper cuts - maybe an ergonomics hack week or something. |
We're gonna do the "blog posts" thing again this year for planning next year, and so I'm gonna think about this, and put some stuff in there. I'll link it back here whenever it gets posted. |
Something else i remembered this morning was how, a long time ago, there was a discussion on trying to remove the notion of For example, instead of the following:
You could do something like:
There may be problems when this is applied to certain traits with lots of methods (like |
DoctestsWhile doctests are a powerful feature, they are still filled with some papercuts that would be worth focusing on for a few new features. Here are a few that i remember hearing about or thinking of:
There are probably other issues that i don't know about, too. |
Source viewA couple smaller points here, but the source-view section of rustdoc output is kinda lackluster compared to the generated API docs. There's a high ceiling for how good a source browser can be (with a proportional amount of work required to do so) so there's a lot of room for improvement here. Here are just a couple ideas, one small, one big:
|
It's true that source view hasn't received much updates for a (very very very) long time now. Should maybe be time that I start taking another look. :) |
One update about And one about the source view - it looks like imperio has opened rust-lang/rust#55707 to implement the first point already! I'm reading through it right now, but it's exciting to be this close this quickly. There are several good ideas going on here (with the promise of more when the open call for blog posts occurs, as @steveklabnik mentioned) but i think it's good to lay out the vague plan i have in mind.
I'm not sure what the core team wants as its own roadmap timeline (i'm not sure how much consideration has been given to it, since the edition work has been ongoing) but i want to make sure we have something to talk about when that planning occurs. A couple more related notes:
|
I'd like to bring back a machine friendly output like JSON. Combined with some templating (either JavaScript or server-side), it can help docs.rs quite a lot. @QuietMisdreavus has written a previous thread on this. Also something that is mentioned in thread: what can we do to integrate it with save-analysis? |
One more idea that keeps re-appearing, is some kind of effort to deal with the "file explosion" problem, where rustdoc needs to create two files for each item in a crate (one real file and one with an old-style name that redirects to the real one). With some crates, this can create thousands of files or more, which is a performance nightmare, especially in the presence of an anti-virus software or on certain filesystems. One way that has been offered to deal with the problem is to radically re-architect how documentation is generated and viewed. This resulted in the "rustdoc rewrite" projects from the beginning of this year, where the idea is to use a machine-readable output (in this case, converted from the save-analysis JSON), then write a rich web application that does one file load - of the data file - and acts like a web server, reading information from the saved data and rendering pages as needed, without storing each item as a separate physical file. The rustdoc rewrites faltered from the save-analysis data not having all the information that the current rustdoc needs, which goes back to the thought that @ishitatsuyuki mentioned: getting rustdoc to output the JSON itself. (Or extending save-analysis with this data, which may be the "cleaner" goal.) This way, we can sort of "let a thousand implementations bloom", and keep the "official" rustdoc around as long as we need. I would like to propose a parallel effort to that, though: @killercup's He made the crate as a proof-of-concept to show how to have an archive of individually-compressed files be served through a web server directly, without having to extract and recompress them. Its docs and design issues explicitly reference using rustdoc output as a basis for these archives, so i think it would make an worthwhile experiment to "cut out the middle-man" and have rustdoc spit out one of these archives in the first place. (The complete plan for fully realizing this solution requires coordination with Cargo, but at least we can start there.) |
I saw that too. We should just remove those duplicates. That'd make the whole situation almost twice better thanks to this.
Adding alternative outputs would be a good start. JSON and markdown would be nice as a start. Also, considering that some people don't want to enable JS, we're a bit limited on this side, otherwise I would have put more JS in pages in order to generate them from those data instead of huge and ugly HTML.
I talked about it with him directly and to sum up what came out: that'd be nice to have it alongside with a different |
As we get close to the end of the year, it would be helpful to try to organize a direction to push rustdoc next year. So far we've been fairly free-form about what we work on, but if we have a few overarching goals to point at, it would be easier to try to attract new contributors or to prioritize work.
That said, what does the team want to see from rustdoc in the coming year? Feel free to write up ideas in this thread. I'll start with some comments of my own that are outstanding items or are things that i can think of.
cc @steveklabnik @GuillaumeGomez @ollie27 @onur (since i can't ping rust-lang teams all at once on here 😅)
The text was updated successfully, but these errors were encountered: