Skip to content

Change rustdoc header anchor rendering #28499

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

Merged
merged 5 commits into from
Sep 20, 2015
Merged

Conversation

semmaz
Copy link
Contributor

@semmaz semmaz commented Sep 18, 2015

This changes how rustdoc generate id and href attributes for section header anchor. Now they are more github-like.

Also fixes breakage in docs caused by this and broken links in "Error Handling" section of book.

r? @steveklabnik
cc @alexcrichton

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

Looks like a few temporary files made their way in by accident? Could those be removed?

@semmaz
Copy link
Contributor Author

semmaz commented Sep 18, 2015

Yeah, my bad, I'm on it.

@@ -0,0 +1,2165 @@
% Error Handling
Copy link
Member

Choose a reason for hiding this comment

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

This file shouldn't be in here

@steveklabnik
Copy link
Member

Oops, just saw the other comments now. This looks good to me if @alexcrichton is happy with it, and with that stuff removed

@semmaz
Copy link
Contributor Author

semmaz commented Sep 18, 2015

Done, temp files are gone!

@alexcrichton
Copy link
Member

Thanks! Can you be sure to add some rustdoc tests for these? It'd be good to ensure we don't regress generating anchors for weird titles like **Foo** *bar* baz!?!&

@semmaz
Copy link
Contributor Author

semmaz commented Sep 18, 2015

Sure!
I should use Markdown for this (like test here), right?

To clarify, this PR only changes what goes to id of a header and href of anchor, visible text is unaffected.

Take a look at output of rustdoc for that title right now (by the way, it seems I missed to add <strong>).

@semmaz
Copy link
Contributor Author

semmaz commented Sep 19, 2015

Added test test html::markdown::tests::test_header ... ok

@steveklabnik
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Sep 19, 2015

📌 Commit 5b4cccc has been approved by steveklabnik

@alexcrichton
Copy link
Member

@semmaz yeah that test is fine, thanks!

@bors
Copy link
Collaborator

bors commented Sep 19, 2015

☔ The latest upstream changes (presumably #28516) made this pull request unmergeable. Please resolve the merge conflicts.

@semmaz
Copy link
Contributor Author

semmaz commented Sep 20, 2015

@steveklabnik rebased. Retry?

@steveklabnik
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Sep 20, 2015

📌 Commit 09c1ce1 has been approved by steveklabnik

@bors
Copy link
Collaborator

bors commented Sep 20, 2015

⌛ Testing commit 09c1ce1 with merge f5a64a6...

bors added a commit that referenced this pull request Sep 20, 2015
This changes how rustic generate `id` and `href` attributes for section header anchor. Now they are more github-like.

Also fixes breakage in docs caused by this and broken links in "Error Handling" section of book.

r? @steveklabnik
cc @alexcrichton
@bors bors merged commit 09c1ce1 into rust-lang:master Sep 20, 2015
@semmaz semmaz deleted the doc-anchor-fix branch September 20, 2015 18:06
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.

5 participants