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

Tracking Issue for RFC 1826: Change the default URL of doc.rust-lang.org #44687

Open
2 tasks
steveklabnik opened this issue Sep 18, 2017 · 24 comments
Open
2 tasks
Assignees
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC P-medium Medium priority T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@steveklabnik
Copy link
Member

This is a tracking issue for the RFC 1826 (rust-lang/rfcs#1826).

Steps:

  • Implement the RFC
  • Switch doc.rust-lang.org over, which is sort of "stabilization" in this case.

Unresolved questions:

No official ones, but there will undoubtedly be tweaks during implementation.

NB: a prototype is at https://rust-docs.herokuapp.com, source here: https://github.com/steveklabnik/rust-docs This can serve as a starting point for discussing said details, but does not literally have to be the basis of implementation.

@steveklabnik steveklabnik added B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Sep 18, 2017
@aidanhs aidanhs added the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label Sep 19, 2017
@steveklabnik steveklabnik added the P-medium Medium priority label Oct 31, 2017
@steveklabnik steveklabnik self-assigned this Oct 31, 2017
@kornelski
Copy link
Contributor

kornelski commented Dec 5, 2017

The prototype behaves like <frameset> without exposing useful URLs. That's very problematic for me, since I can't copy/share/bookmark documentation pages.

I hope that lack of user-visible URLs is just a rough edge of the prototype rather than part of the solution (I don't quite understand the RFC, I feel like I'm missing context for it).

@steveklabnik
Copy link
Member Author

I hope that lack of user-visible URLs is just a rough edge of the prototype rather than part of the solution

Yes, absolutely.

@kzys
Copy link
Contributor

kzys commented Sep 27, 2018

Seems we already have https://doc.rust-lang.org/1.29.0/, https://doc.rust-lang.org/1.28.0/, ... The only missing part here is having a small header on each docs, which can be implemented as a small JavaScript file.

How we can update the JavaScript file and probably https://doc.rust-lang.org/index.html to list all releases? We may be able to generate them from rust-lang/rust's nightly (assuming that the latest nightly includes all stable releases), or have a separate repository.

@kzys
Copy link
Contributor

kzys commented Sep 30, 2018

I made a small demo to show how it would look. The version picker itself doesn't work still. The main purpose of the demo is discussing about the look & feel first.

http://rust-pull-request.s3-website-us-east-1.amazonaws.com/44687/std/

  • Version picker is in the page itself, inserted by JavaScript (no iframe)
  • The picker is "sticky", always shown on the page since Rust is evolving fast still.
  • The version information is hosted as a static JSON file on doc.rust-lang.org (not implemented)

@steveklabnik
Copy link
Member Author

Hey @kzys , thanks for poking at this!

What exactly does

Version picker is in the page itself, inserted by JavaScript

mean? How is it inserted by JS?

@kzys
Copy link
Contributor

kzys commented Oct 5, 2018 via email

@steveklabnik
Copy link
Member Author

Right, so the issue here is:

include the JavaScript file from rustdoc's HTML

We have already produced the HTML for those old releases, and they can't change. So this approach would work going forward, but wouldn't work for releases previous to that.

@kzys
Copy link
Contributor

kzys commented Oct 5, 2018 via email

@steveklabnik
Copy link
Member Author

That's not ideal though.

Yeah, we have a hard constraint on not being able to do this.

"for older releases, please see ..."

The issue with that is that it doesn't solve one of the primary motivations for doing this: people seeing older versions and not realizing they're out of date.

@kzys
Copy link
Contributor

kzys commented Oct 5, 2018

If changing the old docs is not possible, the remaining options are;

Would you mind if I ask the reason of not changing the old docs? I agree we shouldn't do that daily/monthly basis, but what if the change is only once?

@steveklabnik
Copy link
Member Author

steveklabnik commented Oct 5, 2018 via email

@kzys
Copy link
Contributor

kzys commented Oct 5, 2018

Thanks! That make sense.

Does doc.rust-lang.org use S3 + CloudFront according to the HTTP headers? Not so sure since the old issues sometimes mentioned "rewriting". On CloudFront, we may be able to use Lambda@Edge instead of spinning up a http server.

(Disclaimer - I work for Amazon, but not AWS)

@steveklabnik
Copy link
Member Author

doc.rust-lang.org use S3 + CloudFront according to the HTTP headers?

Yep!

On CloudFront, we may be able to use Lambda@Edge instead of spinning up a http server.

That is an intriguing idea!

@Mark-Simulacrum
Copy link
Member

FWIW, I think fixing this by including an empty just file from some common location or path that we can update later (e.g. rust-lang.org/doc-1.23.0.js) would be good. The other side of this is I think changing old HTML files uniformly isn't a bad thing: for one thing it's cheaper than any other solution from a monetary perspective and I don't quite see why it would pose too large a problem. We're not changing static.r-l.o artifacts which I think are far more critical to keep constant vs. docs.r-l.o artifacts...

@steveklabnik
Copy link
Member Author

We're not changing static.r-l.o artifacts

Oh? I thought they were identical. If this is not the case, then I feel like there's more wiggle room.

@Mark-Simulacrum
Copy link
Member

Yes, the docs are served from a different bucket in s3, I'm fairly sure, and if they weren't, we could "easily" start doing so.

@steveklabnik
Copy link
Member Author

Okay, then maybe that is the path forward, then.

@kzys
Copy link
Contributor

kzys commented Oct 5, 2018 via email

@dustinknopoff
Copy link

dustinknopoff commented Dec 28, 2018

I'd like to take a stab at this. I'm a little unclear as to where to start from.

I was thinking @kzys way of injecting some JS in to the existing versions would be best.
screen shot 2018-12-28 at 10 19 17 am

I'd also like to suggest doing something like one of the two mockups above on the version badge on doc.rust-lang and/or on the actual documentation as well.

kzys added a commit to kzys/blog that referenced this issue Jan 2, 2019
@kzys
Copy link
Contributor

kzys commented Jan 2, 2019

Thanks @dustinknopoff!

I'm working on an actual prototype based on the mock. You can try that by copy-and-paste the below JavaScript from browser's console.

s=document.createElement('script');s.type='text/javascript';s.src='https://blog.8-p.info/en/tmp/2019/rustdoc-version-selector.js';document.body.appendChild(s);

The script only supports doc.rust-lang.org's landing page such as https://doc.rust-lang.org/1.31.0/ so far.

My thoughts;

  • While reusing the existing version information looks nice, the coupling between this script and the DOM structure is a bit concerning, in terms of maintenance.
  • What do we want to have in the combo box? @steveklabnik's initial prototype only has stable, beta, nightly. https://docs.python.org/3/ has 5 versions and I don't know why these five. My prototype shows all releases as is, which may be confusing.

@QuietMisdreavus
Copy link
Member

For the people subscribed to this issue: @GuillaumeGomez made a crack at it in #58603, though it may be different than what was being planned here.

@GuillaumeGomez
Copy link
Member

Completely forgot about this one actually. :-.

@jackh726
Copy link
Member

I'm going to go ahead and assign this to @rust-lang/infra, but it might make more sense under T-rustdoc?

@jackh726 jackh726 added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Mar 18, 2022
@GuillaumeGomez
Copy link
Member

It's both so it's a good idea to include them as well.

@jackh726 jackh726 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC P-medium Medium priority T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

9 participants