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

Update links in redirects #1667

Merged
merged 1 commit into from
Dec 7, 2018
Merged

Conversation

mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Dec 7, 2018

Link directly to the 1.30 versions, since the relative links no longer work.

@mbrubeck
Copy link
Contributor Author

mbrubeck commented Dec 7, 2018

I guess we should make these link to the 2018 edition where available

@mbrubeck
Copy link
Contributor Author

mbrubeck commented Dec 7, 2018

Would you prefer to include both Second Edition and "Current Edition" links, or just Current Edition?

These redirects were originally in place to preserve old links to the first edition book, so I don't think they need to link to every edition. Just linking to the original content (First Edition) and the latest content (Current Edition) seems best.

@mbrubeck
Copy link
Contributor Author

mbrubeck commented Dec 7, 2018

Updated so that each file has "First Edition" and "Current Edition" links where possible (no Second Edition).

@carols10cents
Copy link
Member

carols10cents commented Dec 7, 2018

Hi Matt :) I agree that the places that say "second edition" should say "current edition" and link to the current edition instead, as you've done here. However,

Link directly to the 1.30 versions, since the relative links no longer work.

Can you clarify what you mean by "the relative links no longer work"? If I do rustup docs with Rust 1.31.0 and then visit, say:

file:///Users/carolnichols/.rustup/toolchains/stable-x86_64-apple-darwin/share/doc/rust/html/book/deref-coercions.html

I get a page that says:

Here are the relevant sections in the new and old books:

    In the second edition: Ch 15.02 — Treating Smart Pointers like Regular References with the Deref Trait
    In the first edition: Ch 3.33 — Deref coercions

The first edition link goes to file:///Users/carolnichols/.rustup/toolchains/stable-x86_64-apple-darwin/share/doc/rust/html/book/first-edition/deref-coercions.html, which says:

Deref coercions

The first edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out the current version of the book instead.

If you have an internet connection, you can find a copy distributed with Rust 1.30.

And "find a copy distributed with Rust 1.30" links to https://doc.rust-lang.org/1.30.0/book/first-edition/deref-coercions.html, as you have here.

So I do think this is working the way @steveklabnik intended? Is it the extra click and the insinuation that there's going to be content there and then isn't that makes it seem like it doesn't work?

@mbrubeck
Copy link
Contributor Author

mbrubeck commented Dec 7, 2018

Is it the extra click and the insinuation that there's going to be content there and then isn't that makes it seem like it doesn't work?

Yeah, exactly. This PR links directly to the content, instead of to a second old/redirected URL where you have to click through an extra link.

@carols10cents
Copy link
Member

Ok, I see. I do like the extra "If you have an internet connection" bit that's on the redirect pages, because not shipping the first edition with Rust is a change... wdyt about working that in on the redirect pages?

@mbrubeck
Copy link
Contributor Author

mbrubeck commented Dec 7, 2018

I don't think there's a common case where users load these "redirects/" pages while offline. The common way to find them is by following old links from search engines, blog posts, discussion threads, etc.

If someone is still relying on these redirect files to navigate their local docs, I think the fact that the first edition links now go to the online site (just like the rustbyexample links) is clear enough without adding more clutter to the page. (We already try to de-emphasize the first edition links by making them smaller, so we clearly think most users want the new edition anyways.)

Copy link
Member

@carols10cents carols10cents left a comment

Choose a reason for hiding this comment

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

Ok, you've convinced me :) Thank you!

@carols10cents carols10cents merged commit 74d81d8 into rust-lang:master Dec 7, 2018
bors added a commit to rust-lang/rust that referenced this pull request Dec 8, 2018
Update the book to fix some edition-related bugs

I'd love to have this included in a point release if one happens, but the changes aren't worth doing a point release on their own IMO. I'd definitely like to see this backported to beta.

The most urgent changes included here are:

- Chapter 19.6, on macros (including the macro changes that just stabilized), [is cut off](rust-lang/book#1668) because of an ill-placed newline in a comment that [pulldown-cmark interprets incorrectly](pulldown-cmark/pulldown-cmark#124).
- [The `Cargo.toml` shown in the Guessing Game example in Chapter 2 (and one in Chapter 14) doesn't have `edition="2018"`](rust-lang/book#1671), which can be confusing depending on whether the readers have it in theirs or not, think they should remove it if they have it, and the rest of the chapter assumes it's there and the code doesn't compile if you don't have it.
- The redirects implemented as part of only shipping the 2018 edition of the book sometimes lead to [having to click through 2 redirect pages](rust-lang/book#1667) when it could be just one.

There are other small corrections included that were made since the last time the book was updated, but those aren't urgent.

cc @steveklabnik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants