-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Change the default URL of doc.rust-lang.org #1826
Change the default URL of doc.rust-lang.org #1826
Conversation
It's worth noting that this changes the effect of typing On the other hand, going directly to the current version's docs is good for archival purposes, if it's being linked somewhere that could be revisited after a while. It becomes apparent exactly what version of rust you're talking about. In the course of typing this comment up I realized this is probably a better trade-off. In talking with Steve about it on IRC, though, another alternative idea came about. It might be possible to turn the root index into a listing of docs subfolders, just to say "here are links to stable/beta/nightly, and specific permalinks for all these versions individually". This index would need to be updated as part of the release process, in lieu of the current option of changing the redirect. |
I've added it as an alternative, but if people like the idea, I'd be okay with changing this to suggest that, frankly. |
👍 |
text/0000-change-doc-default-urls.md
Outdated
that's affecting other parts of the project in an adverse way. | ||
|
||
The big underlying issue here is that people tend to link to `/`, becuase it's | ||
what you get by defualt. By changing the default, people will link to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "defualt"
text/0000-change-doc-default-urls.md
Outdated
[design]: #detailed-design | ||
|
||
https://doc.rust-lang.org/ should issue a redirect to https://doc.rust-lang.org/RELEASE, | ||
where RELEASE is the latest stable release, like `1.14.0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One concern I have with this: This will result in more people linking to https://doc.rust-lang.org/<RELEASE>
URLs. This means that more people are going to be looking at potentially outdated documentation after new releases happen. I think this should at least be mentioned in the # Drawbacks
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution to this is straight-forward: an "this is old documentation pls go here for current stable" banner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example: outdated Django and development Django have banners at the top, and https://docs.djangoproject.com/ redirects to the current latest version, https://docs.djangoproject.com/en/1.10/.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have historically resisted doing that because it means modifying an old release after the fact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use an Iframe or server side magic to avoid modifying it? I agree downloaded/released docs should be immutable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, those are possible options. This is an implementation concern, not an objection to the whole idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boost hit this problem as well. http://www.boost.org/libs/regex/doc/html/index.html redirects to a version-specific url, and they needed to add the "click here for latest version" link because all the stack overflow posts, for example, were pointing to ancient documentation.
This makes a lot of sense to me; it would push people more toward stable URLs and thus enable us to change rustdoc itself more freely. 👍 from me. |
|
||
* When we release the new book, links are going to break. This has multiple | ||
ways of being addressed, and so isn't a strong motivation, but fixing this | ||
issue would help out a lot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of links would break, and why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As one example, the new book does not have the same chapters as the old book, so for example, https://doc.rust-lang.org/stable/book/conditional-compilation.html will be a dead link someday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that chapter is removed, an appropriate redirect should be added like we have for https://doc.rust-lang.org/guide.html.
can lead to degenerate situations in certain crates. `libc`, one of the most | ||
important crates in Rust, and included in the official docs, [had their docs | ||
break](https://github.com/rust-lang/libc/pull/438) because so many extra | ||
files were generated that GitHub Pages refused to serve them any more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of rust-lang/rust#38858 the libc
docs are no longer included with the std
docs.
Also libc
isn't exactly special. It did hit a rather bad bug in rustdoc (rust-lang/rust#37773) which caused way too many files to be generated. The redirects simply doubled the number of files rustdoc generated but that is true of every crate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still affects how the crate hosts its docs, even though they're not included in the distribution.
I think it would be better to have everything in Redirecting to the version specific docs doesn't help the problem of redirects if we change the URL scheme. (Side note: @steveklabnik I suggest you change the rendered link at the top of this thread to rendered. The link there at the moment is out of date.) |
Given the topic of this RFC, this is pretty funny. Thanks. |
They're not actually "stable", though. As in, we don't make guarantees that any documentation URL will live forever. This is the root of the problem. |
Well lets start making such guarantees. I propose all URLs in versioned docs and anything stable in |
This is infeasible for |
We can. For example rustdoc is currently generating links for two URL schemes: It's already too late. There is a lot of content out there linking to If we changed |
This is exactly what caused the problem in the first place. And this still doesn't address all of the other ways in which URLs change and break.
They are already going to end up breaking. This is an attempt to stem the tide. No better time to change things than the present.
I'm not sure what specifically would happen here; that depends on @brson , with what we can do. |
@steveklabnik this RFC looks quite good to me, thanks for writing it up! My main concern is the same as @frewsxcv's concern above about notifying readers of old documentation that they're doing just that, reading old documentation. This is definitely an existing bug, but I think an implementation of this RFC as-is would exacerbate the problem to the point that it's much higher priority than it is right now. I'd be fine with either explicitly listing this drawback and accepting the RFC on that basis, or including a solution for the problem in the RFC. I agree that some iframe-like solution would probably work well here. @ollie27 I disagree that we should use historical precedent to just stabilize all existing URLs. There's quite a few URLs there and I'd ideally like to remove all the old ones one day. I'd like to move over to |
I agree in general. And as stated, 'change doc.rust-lang.org to redirect to the latest release instead of an alias of stable', that's fine and we can do that. But there are a few issues raised here, and I think not all of them are solved by the proposal. For example, this doesn't address the It also doesn't address the One of the fallouts from this is that the URLs used in RELEASES.md will need to change going forward. Today those link to It's not clear whether just Other things we could do: We could make Technically, doing this proposal means adding a step to every release to change the redirection. Today that means updating rewrite rules in an nginx proxy. As an easier alternative I might suggest we create a static site just to sit at Well, that's my thoughts for now. |
If this is what we do, then we will be breaking every existing URL to that set of docs. Which is counter to the ultimate goal of having stable doc URLs, but may be for the greater good. If we're willing to break those URLs once, then I might argue we ought to go ahead and break |
I was totally wrong about this. They link to |
I tossed together a very quick example of what a drop-down might look like. https://rust-docs.herokuapp.com/ and https://github.com/steveklabnik/rust-docs it doesn't work on heroku because, well, it's loading content cross-domain, but that's fixable if we wanted to do this. It also currently doesn't support any URLs other than |
It does because we no longer have two versions of the same docs.
This is just never going to be true unless we agree to never remove or change URLs, which is not possible, really. |
(thanks to @alexcrichton and @brson that URL should work very soon) |
Right now the easiest link to get for result is "https://doc.rust-lang.org/std/result/". If the easiest link to get becomes "https://doc.rust-lang.org/1.14.0/std/result/", then we'll end up with 16-and-growing links to "the result documentation" instead of just 2. Is there any discoverability/searchability issue caused by that if there's no |
This would be the same; it would redirect. That said...
This is a semantic issue that's not entirely clear. That is, each releases docs are canonical for their release. |
It'd go to the book's homepage; the bookshelf is broader than just the book. It incorporates the nomicon, etc.
what we currently do for this is something like https://doc.rust-lang.org/guide-ffi.html; if we went with the dynamic site for doc.rust-lang.org, we could do something more comprehensive. |
This RFC has gone stale. What's the current state of play? Somebody on the doc team want to push this forward? |
Last I chatted with @rust-lang/core , we wanted to ship the version switcher, and due to trying to knock out the rest of the book, I haven't had the chance to implement it yet. I'm hoping to do so relatively soon, and the docs team has a much lower RFC volume than the other teams, so leaving it open doesn't really hurt us. |
Ping: what's the status here? |
Is moving forward with this dependent on the implementation being done? I don't see any big outstanding unanswered questions for this |
Status is, everyone wanted to see an implementation, I haven't been able to prioritize it. That simple implementation above is still there. |
I am going to re-read and possibly update the text soon; maybe since this is "waiting an implementation", this is a good eRFC? |
@rfcbot fcp merge I have updated the RFC to explicitly contain the version-switching language, and would like to move this to FCP. |
Team member @steveklabnik has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@rfcbot reviewed |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
As written, this RFC does not actually fix the duplication issue, it only reduces it. Currently the documentation for the latest stable release exist in three places ( Neither does it fix the link stability issue, it only makes it more complicated: Currently Since no perfect solution seems possible, I would suggest simply doing a permanent redirect from |
Yeah, this seems fine to me. Thanks! |
The final comment period is now complete. |
Huzzah! The @rust-lang/docs team has decided to accept this RFC. To track further discussion, subscribe to the tracking issue here: rust-lang/rust#44687 |
rendered
doc.rust-lang.org should redirect to the latest stable release's documentation, not duplicate
/stable
./cc @rust-lang/docs