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

Fix doc link #52404

Merged
merged 1 commit into from
Jul 17, 2018
Merged

Fix doc link #52404

merged 1 commit into from
Jul 17, 2018

Conversation

felixrabe
Copy link
Contributor

@felixrabe felixrabe commented Jul 15, 2018

Result of first searching via:

find src -type f -exec fgrep -l dynamically-sized-types--sized {} \;

and then replacing all relevant occurrences via:

find src/{libcore,test/ui} -type f -exec sed -i.bak \
  s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g {} \;
find src -type f -name '*.bak' -exec rm {} \;

(Note: Commands run on macOS 10.13 (BSD). sed -i.bak should work on
GNU/Linux as well, but not tested.)

EDIT: Did not compile / test Rust for this change at all.

Clickable links for comparison:
https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken)
https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed)

@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Jul 15, 2018

📌 Commit 2ffdf0b115c7319176dd2756af4803933133ee2f has been approved by GuillaumeGomez

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 15, 2018
@kennytm
Copy link
Member

kennytm commented Jul 17, 2018

@bors r- rollup- p=1

A lot of new UI tests have included the broken link. You may see them after rebasing on the latest master. For reference, see the error log in #52433.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 17, 2018
The link for comparison:

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken)

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed)

This commit is the result of (first) searching via:

    find src -type f -print0 | xargs -0 fgrep -l dynamically-sized-types--sized

and then replacing all relevant occurrences via:

    find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \
      s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g
    find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm

(Note: Commands run on macOS 10.13 (BSD).  `sed -i.bak` should work on
GNU/Linux as well, but not tested.)
@felixrabe
Copy link
Contributor Author

@kennytm refined my commit commands and have re-run them against master.

@GuillaumeGomez
Copy link
Member

Ok, let's have it tested on its own. Once CI is ok, r=me

@kennytm
Copy link
Member

kennytm commented Jul 17, 2018

@bors r=GuillaumeGomez

@bors
Copy link
Contributor

bors commented Jul 17, 2018

📌 Commit 88e9af0 has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 17, 2018
@bors
Copy link
Contributor

bors commented Jul 17, 2018

⌛ Testing commit 88e9af0 with merge 1c84d81...

bors added a commit that referenced this pull request Jul 17, 2018
Fix doc link

Result of first searching via:

    find src -type f -exec fgrep -l dynamically-sized-types--sized {} \;

and then replacing all relevant occurrences via:

    find src/{libcore,test/ui} -type f -exec sed -i.bak \
      s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g {} \;
    find src -type f -name '*.bak' -exec rm {} \;

(Note: Commands run on macOS 10.13 (BSD).  `sed -i.bak` should work on
GNU/Linux as well, but not tested.)

EDIT: Did not compile / test Rust for this change at all.

Clickable links for comparison:
https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken)
https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed)
@bors
Copy link
Contributor

bors commented Jul 17, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: GuillaumeGomez
Pushing 1c84d81 to master...

@bors bors merged commit 88e9af0 into rust-lang:master Jul 17, 2018
@ehuss
Copy link
Contributor

ehuss commented Jul 19, 2018

Unfortunately this link will be broken again once 1.28 is released. The new section header will be #dynamically-sized-types-and-the-sized-trait.

cc @carols10cents or @steveklabnik is there maybe a better way to have more stable URLs?

@kennytm
Copy link
Member

kennytm commented Jul 19, 2018

I think mdbook should support adding an anchor via HTML <a name="dynamically-sized-types-and-sized"></a>?

@felixrabe
Copy link
Contributor Author

@ehuss @kennytm If the 1.28 link change is the only one you anticipate, It should be easy to modify and re-run the commands from the commit description. Or you can ping me and I'll do it again.

@carols10cents
Copy link
Member

The second edition is now frozen because the book has been printed and we intend to keep the second edition the same as what was printed, so these section headings should no longer be changing, if that helps.

@ehuss
Copy link
Contributor

ehuss commented Jul 30, 2018

@carols10cents can small changes like adding <a> tags be made, or is it completely frozen? Maybe it would be easiest to just go ahead and have @felixrabe update for the new heading?

@carols10cents
Copy link
Member

carols10cents commented Jul 31, 2018

@carols10cents can small changes like adding tags be made, or is it completely frozen? Maybe it would be easiest to just go ahead and have @felixrabe update for the new heading?

@ehuss I don't understand? Why do you need to add a link in the book?

I think updating the link here to https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized is correct because the <a> tag for #dynamically-sized-types-and-sized is in the second edition and won't change again.

@ehuss
Copy link
Contributor

ehuss commented Jul 31, 2018

Why do you need to add a link in the book?

I was just thinking for people running older versions of the compiler, it will still point to the old location. Adding an <a name=".."> tag with the old name would make it work for them. However, I don't think it is all that important (it's pretty easy to figure it out when the page doesn't scroll). Whichever is easiest!

@felixrabe
Copy link
Contributor Author

felixrabe commented Aug 5, 2018

felixrabe added a commit to felixrabe/rust that referenced this pull request Aug 5, 2018
Similar to rust-lang#52404. The link for comparison:

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (broken)

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, stable 2nd ed)

-   https://doc.rust-lang.org/nightly/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2nd ed)

-   https://doc.rust-lang.org/nightly/book/2018-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2018 ed)

This commit is the result of (first) searching via ripgrep (0.8.1 -SIMD -AVX):

    rg -l dynamically-sized-types-and-sized

and then replacing all relevant occurrences via:

    find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \
      s/dynamically-sized-types-and-sized/dynamically-sized-types-and-the-sized-trait/g
    find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm

(Note: Tested on on macOS 10.13 (BSD). `sed -i.bak` should work on Linux
(GNU sed) as well, but not tested.)
@felixrabe felixrabe mentioned this pull request Aug 5, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Aug 9, 2018
…llaumeGomez

Fix doc link (again)

Similar to rust-lang#52404. The link for comparison:

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (broken)

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, stable 2nd ed)

-   https://doc.rust-lang.org/nightly/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2nd ed)

-   https://doc.rust-lang.org/nightly/book/2018-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2018 ed)

This commit is the result of (first) searching via ripgrep (0.8.1 -SIMD -AVX):

    rg -l dynamically-sized-types-and-sized

and then replacing all relevant occurrences via:

    find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \
      s/dynamically-sized-types-and-sized/dynamically-sized-types-and-the-sized-trait/g
    find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm

(Note: Tested on on macOS 10.13 (BSD). `sed -i.bak` should work on Linux
(GNU sed) as well, but not tested.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants