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

Add --generate-link-to-definition option when building on docs.rs #1327

Merged
merged 2 commits into from Jul 29, 2023

Conversation

GuillaumeGomez
Copy link
Contributor

@GuillaumeGomez GuillaumeGomez commented Jul 14, 2023

This option generates links in source code pages, allowing to jump to definition and to jump back to doc. It makes browsing the source code pages much nicer. You can see it in action here.

Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

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

Looks like a nice addition

Cargo.toml Outdated
@@ -21,7 +21,7 @@ include = ["src/", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"]
# To build locally:
# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open
Copy link
Member

Choose a reason for hiding this comment

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

Worth adding here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@dhardy
Copy link
Member

dhardy commented Jul 15, 2023

Would you mind fixing the doc tests (see CI failure) at the same time? Thanks

@vks
Copy link
Collaborator

vks commented Jul 28, 2023

@dhardy Can this be merged? I only see some broken links.

@dhardy
Copy link
Member

dhardy commented Jul 29, 2023

Sure. Sorry, got distracted.

@dhardy dhardy merged commit 176e736 into rust-random:master Jul 29, 2023
11 of 12 checks passed
@GuillaumeGomez GuillaumeGomez deleted the generate-links-to-def branch July 29, 2023 10:40
elichai pushed a commit to elichai/rand that referenced this pull request Aug 13, 2023
…ust-random#1327)

* Add `--generate-link-to-definition` option when building on docs.rs

* Fix documentation issues
@TheIronBorn
Copy link
Collaborator

Are we certain this is working? I had to enable RUSTDOCFLAGS=-Zunstable-options locally and the master docs don't seem to have it enabled

@GuillaumeGomez
Copy link
Contributor Author

On docs.rs, -Zunstable-options is already passed by docs.rs builder. serde just added this flag and it's working as expected: https://docs.rs/serde/latest/src/serde/ser/impossible.rs.html

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.

None yet

4 participants