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

Generate links to definition in rustdoc source code pages #2611

Closed
alice-i-cecile opened this issue Aug 6, 2021 · 5 comments
Closed

Generate links to definition in rustdoc source code pages #2611

alice-i-cecile opened this issue Aug 6, 2021 · 5 comments
Labels
A-Build-System Related to build systems or continuous integration C-Docs An addition or correction to our documentation

Comments

@alice-i-cecile
Copy link
Member

How can Bevy's documentation be improved?

rust-lang/rust#84176 (just merged) allows rustdoc to generate links to definitions in source code pages. This new feature is disabled by default. Once this moves off nightly we should enable the feature with the --generate-link-to-definition option.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-Build-System Related to build systems or continuous integration S-Blocked This cannot move forward until something else changes labels Aug 6, 2021
@mockersf
Copy link
Member

mockersf commented Aug 9, 2021

Doesn't this need to be enabled by the one building the docs which is not us but docs.rs?

The doc built during CI are not published anywhere, having the links there wouldn't be visible

@bjorn3
Copy link
Contributor

bjorn3 commented Aug 9, 2021

docs.rs uses nightly rustdoc. It also allows you to pass arbitrary flags to rustdoc using a section in Cargo.toml I believe.

@mockersf
Copy link
Member

mockersf commented Aug 9, 2021

@BD103 BD103 removed the S-Blocked This cannot move forward until something else changes label Apr 12, 2024
@BD103
Copy link
Member

BD103 commented Apr 12, 2024

Marking this as unblocked. We now use nightly to build our docs, and so does docs.rs.

github-merge-queue bot pushed a commit that referenced this issue Jul 29, 2024
…docs.bevyengine.org (#12965)

# Objective

- Fix issue #2611

## Solution

- Add `--generate-link-to-definition` to all the `rustdoc-args` arrays
in the `Cargo.toml`s (for docs.rs)
- Add `--generate-link-to-definition` to the `RUSTDOCFLAGS` environment
variable in the docs workflow (for dev-docs.bevyengine.org)
- Document all the workspace crates in the docs workflow (needed because
otherwise only the source code of the `bevy` package will be included,
making the argument useless)
- I think this also fixes #3662, since it fixes the bug on
dev-docs.bevyengine.org, while on docs.rs it has been fixed for a while
on their side.

---

## Changelog

- The source code viewer on docs.rs now includes links to the
definitions.
@NthTensor
Copy link
Contributor

Closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration C-Docs An addition or correction to our documentation
Projects
None yet
Development

No branches or pull requests

5 participants