Skip to content

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

Merged
dhardy merged 2 commits into
rust-random:masterfrom
GuillaumeGomez:generate-links-to-def
Jul 29, 2023
Merged

Add --generate-link-to-definition option when building on docs.rs#1327
dhardy merged 2 commits into
rust-random:masterfrom
GuillaumeGomez:generate-links-to-def

Conversation

@GuillaumeGomez

@GuillaumeGomez GuillaumeGomez commented Jul 14, 2023

Copy link
Copy Markdown
Contributor

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.

@dhardy dhardy left a comment

Copy link
Copy Markdown
Member

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

Comment thread 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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍

@dhardy

dhardy commented Jul 15, 2023

Copy link
Copy Markdown
Member

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

@GuillaumeGomez GuillaumeGomez force-pushed the generate-links-to-def branch from 54142af to 0a15e81 Compare July 15, 2023 12:40
@vks

vks commented Jul 28, 2023

Copy link
Copy Markdown
Contributor

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

@dhardy

dhardy commented Jul 29, 2023

Copy link
Copy Markdown
Member

Sure. Sorry, got distracted.

@dhardy dhardy merged commit 176e736 into rust-random:master Jul 29, 2023
@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
Copy Markdown
Contributor

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
Copy Markdown
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

benjamin-lieser pushed a commit to benjamin-lieser/rand that referenced this pull request Feb 5, 2025
…ust-random#1327)

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

* Fix documentation issues
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.

4 participants