Skip to content
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

Merged
merged 5 commits into from
Sep 18, 2017

Conversation

steveklabnik
Copy link
Member

@steveklabnik steveklabnik commented Dec 22, 2016

rendered

doc.rust-lang.org should redirect to the latest stable release's documentation, not duplicate /stable.

/cc @rust-lang/docs

@steveklabnik steveklabnik added the T-doc Relevant to the documentation team, which will review and decide on the RFC. label Dec 22, 2016
@QuietMisdreavus
Copy link
Member

It's worth noting that this changes the effect of typing doc.rust-lang-org into a web browser. Right now, without the subfolder, it's effectively an alias for /stable, meaning "the current stable docs, regardless of version". Keeping the same effect would mean redirecting to /stable instead of /VERSION.

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.

@steveklabnik
Copy link
Member Author

I've added it as an alternative, but if people like the idea, I'd be okay with changing this to suggest that, frankly.

@GuillaumeGomez
Copy link
Member

👍

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "defualt"

[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`.
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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/.

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member

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.

@aturon
Copy link
Member

aturon commented Jan 11, 2017

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.
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.
Copy link
Member

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.

Copy link
Member Author

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.

@ollie27
Copy link
Member

ollie27 commented Jan 11, 2017

I think it would be better to have everything in / redirect to /stable/ instead. This would mean that /stable/ would be the canonical URL that would be shared, posted online and hopefully what search engine would link to. It has the advantage of always being the latest stable docs which is what I believe most people actually want.

Redirecting to the version specific docs doesn't help the problem of redirects if we change the URL scheme. /std/vec/struct.Vec.html and /stable/std/vec/struct.Vec.html work now and I see no reason why they shouldn't continue to work forever.

(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.)

@steveklabnik
Copy link
Member Author

(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.

@steveklabnik
Copy link
Member Author

It has the advantage of always being the latest stable docs which is what I believe most people actually want.

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.

@ollie27
Copy link
Member

ollie27 commented Jan 11, 2017

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 / and /stable/ should live forever.

@steveklabnik
Copy link
Member Author

I propose all URLs in versioned docs and anything stable in / and /stable/ should live forever.

This is infeasible for / and /stable, because it means that we can never update Rustdoc URLs, we can never change section headers in any long-form documentation, we can never re-organize docs.

@ollie27
Copy link
Member

ollie27 commented Jan 11, 2017

This is infeasible for / and /stable, because it means that we can never update Rustdoc URLs, we can never change section headers in any long-form documentation, we can never re-organize docs.

We can. For example rustdoc is currently generating links for two URL schemes: /std/vec/struct.Vec.html and /std/vec/Vec.t.html. Swapping which one is the redirect gives us a new URL scheme and no links break. The long-form docs require a bit of care but it's no different from any other website.

It's already too late. There is a lot of content out there linking to / and /stable/ which we can't just ignore.

If we changed / to redirect to version specific docs and changed the rustdoc URL scheme, what would happen to /std/vec/struct.Vec.html? Would it break?

@steveklabnik
Copy link
Member Author

For example rustdoc is currently generating links for two URL schemes: /std/vec/struct.Vec.html and /std/vec/Vec.t.html.

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.

It's already too late. There is a lot of content out there linking to / and /stable/ which we can't just ignore.

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.

If we changed / to redirect to version specific docs and changed the rustdoc URL scheme, what would happen to /std/vec/struct.Vec.html? Would it break?

I'm not sure what specifically would happen here; that depends on @brson , with what we can do.

@alexcrichton
Copy link
Member

@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 Vec.t.html and such if possible. I think @steveklabnik's argument here provides us maximal flexibility into the future without really that much cost. With an explicit warning that "you're looking at older docs" you can easily switch to newer docs, which in most cases won't really be that much different.

@brson
Copy link
Contributor

brson commented Jan 12, 2017

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 rel=canonical issue, which is mentioned in the RFC, does it?

It also doesn't address the stable/ beta/ nightly/ paths not having stable links, though I think it is hoping that culturally we will be less inclined to use those links.

One of the fallouts from this is that the URLs used in RELEASES.md will need to change going forward. Today those link to stable/, under the assumption that stable APIs' URLs won't change. Places like that, where people are publishing URLs will need to change. That does seem like an education issue. If people continue using the stable/ URL then the goal is not accomplished. There may be other fonts of rustdoc URLs like the relnotes that need to be educated about the proper URL.

It's not clear whether just / is a redirect, or whether any URL that looks like it's part of the root doc set is redirected. The latter is harder to write rules for. So I'd vote for the former.

Other things we could do:

We could make stable/ URLs redirect to / and completely kill it.

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 doc.rust-lang.org/, and update that instead. But, as a doc landing page there would be a lot of functional overlap with www.rust-lang.org/documentation.html. So we could think about redirecting that to doc.rust-lang.org as well, but then we have to think about i18n. Hm...

Well, that's my thoughts for now.

@brson
Copy link
Contributor

brson commented Jan 12, 2017

It's not clear whether just / is a redirect, or whether any URL that looks like it's part of the root doc set is redirected. The latter is harder to write rules for. So I'd vote for the former.

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 stable/ too.

@brson
Copy link
Contributor

brson commented Jan 12, 2017

One of the fallouts from this is that the URLs used in RELEASES.md will need to change going forward. Today those link to stable/

I was totally wrong about this. They link to /, not stable/.

@steveklabnik
Copy link
Member Author

steveklabnik commented Jan 13, 2017

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 /, but given that this only took me a few hours total, I'd imagine if we were serious about this, we could roll this into this RFC.

@steveklabnik
Copy link
Member Author

@brson:

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 rel=canonical issue, which is mentioned in the RFC, does it?

It does because we no longer have two versions of the same docs.

It also doesn't address the stable/ beta/ nightly/ paths not having stable links, though I think it is hoping that culturally we will be less inclined to use those links.

This is just never going to be true unless we agree to never remove or change URLs, which is not possible, really.

@steveklabnik
Copy link
Member Author

(thanks to @alexcrichton and @brson that URL should work very soon)

@scottmcm
Copy link
Member

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 rel=canonical link from the version link to the /stable one and this is is done first?

@steveklabnik
Copy link
Member Author

steveklabnik commented Jan 22, 2017

Right now the easiest link to get for result is "https://doc.rust-lang.org/std/result/".

This would be the same; it would redirect. That said...

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 rel=canonical link from the version link to the /stable one and this is is done first?

This is a semantic issue that's not entirely clear. That is, each releases docs are canonical for their release.

@steveklabnik
Copy link
Member Author

doc.rust-lang.org/book will go to the bookshelf homepage

It'd go to the book's homepage; the bookshelf is broader than just the book. It incorporates the nomicon, etc.

could we redirect (or suggest trying via HTML) anything not found under /book/ to the corresponding URL that includes the last rust release number that the old book exists under?

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.

@aturon
Copy link
Member

aturon commented Apr 29, 2017

This RFC has gone stale. What's the current state of play? Somebody on the doc team want to push this forward?

@steveklabnik
Copy link
Member Author

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.

@aturon
Copy link
Member

aturon commented Sep 6, 2017

Ping: what's the status here?

@frewsxcv
Copy link
Member

frewsxcv commented Sep 6, 2017

Is moving forward with this dependent on the implementation being done? I don't see any big outstanding unanswered questions for this

@steveklabnik
Copy link
Member Author

Status is, everyone wanted to see an implementation, I haven't been able to prioritize it. That simple implementation above is still there.

@steveklabnik
Copy link
Member Author

I am going to re-read and possibly update the text soon; maybe since this is "waiting an implementation", this is a good eRFC?

@steveklabnik
Copy link
Member Author

@rfcbot fcp merge

I have updated the RFC to explicitly contain the version-switching language, and would like to move this to FCP.

@rfcbot rfcbot added the proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. label Sep 8, 2017
@rfcbot
Copy link
Collaborator

rfcbot commented Sep 8, 2017

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.

@frewsxcv
Copy link
Member

frewsxcv commented Sep 8, 2017

@rfcbot reviewed

2 similar comments
@QuietMisdreavus
Copy link
Member

@rfcbot reviewed

@GuillaumeGomez
Copy link
Member

@rfcbot reviewed

@rfcbot
Copy link
Collaborator

rfcbot commented Sep 8, 2017

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. and removed proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. labels Sep 8, 2017
@JonSeverinsson
Copy link

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 (/..., /stable/..., and /«version_number»/...). If this RFC gets implemented it would still exist in two places. (/stable/..., and /«version_number»/...). Also note that since the target RFC seems to imply that the /... -> /«version_number»/... redirection should be updated every release, it would have to be a temporary redirection, and at least Google and Bing require a permanent redirection in order to drop a search result in favor of the redirection target, so there would still be triplicate search results.

Neither does it fix the link stability issue, it only makes it more complicated: Currently /... and /stable/... is unstable, while /«version_number»/... is stable. If this RFC gets implemented,
/stable/... would be unstable (like before), /«version_number»/... would be stable (like before), and /... would become an unstable redirection to a stable location (so linking to /... would be unstable, but linking to the page you get redirected to if you follow the unstable link would be stable), a quite confusing state of affairs...

Since no perfect solution seems possible, I would suggest simply doing a permanent redirect from /... to /stable/.... It would not change the stability of any URL, and it would at least turn triplicate search results into merely duplicate search results...

@steveklabnik
Copy link
Member Author

Since no perfect solution seems possible, I would suggest simply doing a permanent redirect from /... to /stable/.... It would not change the stability of any URL, and it would at least turn triplicate search results into merely duplicate search results...

Yeah, this seems fine to me. Thanks!

@rfcbot
Copy link
Collaborator

rfcbot commented Sep 18, 2017

The final comment period is now complete.

@steveklabnik
Copy link
Member Author

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

@Centril Centril added the A-web-presence Marketing / web presence / PSA related proposals & ideas label Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web-presence Marketing / web presence / PSA related proposals & ideas final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. T-doc Relevant to the documentation team, which will review and decide on the RFC.
Projects
None yet
Development

Successfully merging this pull request may close these issues.