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

Link to official examples from docs.rs documentation #1934

Closed
alice-i-cecile opened this issue Apr 15, 2021 · 6 comments
Closed

Link to official examples from docs.rs documentation #1934

alice-i-cecile opened this issue Apr 15, 2021 · 6 comments
Labels
C-Docs An addition or correction to our documentation C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@alice-i-cecile
Copy link
Member

How can Bevy's documentation be improved?

Searching a term on docs.rs (or through your IDE's representation) is most user's first step when trying to understand how a function or struct work. For good reason, much of our documentation right now lives in the form of longer-form examples in the examples folder of this repo.

We should bridge this gap, by linking to these examples from the official documentation created through in-line comments.

Generally speaking, these links should live at the end of the doc-string comment, as they are most useful for readers who need more in-depth advice. Be sure to link to the latest branch of the examples, to avoid pointless churn on every release (or misleading examples when pointing to main).

Context

This was noticed in #1920. We will want better dead link detection (see #1579) to ensure that these links can stay fresh even if we move examples around.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation S-Needs-Triage This issue needs to be labelled C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy and removed S-Needs-Triage This issue needs to be labelled labels Apr 15, 2021
@hasanhaja
Copy link

Hi, I'm new to the code base and I don't have any experience contributing to open source but I want to start and offer my help. Would you be able to give me some pointers on how I can get familiar with the code base to tackle this issue? Should I start in the examples folder, the official documentation or both?

@alice-i-cecile
Copy link
Member Author

@hasanhaja sure, this is a great way to learn the code base! I'm also very active on Discord; feel free to say hi in #docs if you have quick questions.

I think that working from the examples folder is going to be the most sensible approach here. Make a draft pull request, add a check-list for the examples and then methodically go through each of the examples and try to get at least one link in place for each example.

As is typical in Rust, our documentation is built automatically from doc comments on the source code. You can find where that code might be by searching for it on Github or on docs.rs; just be mindful that you need to add the docs where the code is first defined, not where it's re-exported. We can help you write supporting documentation for any of the important concepts mentioned in those PRs if they're lacking / missing.

In order to keep the review size small / the PRs merged quickly, I think one folder per PR is a pretty good chunk size :)

bors bot pushed a commit that referenced this issue May 5, 2021
I linked to examples within the rustdoc for the 2d examples as per issue #1934
@hasanhaja
Copy link

Sorry for taking so long to get back to you, but I won't be able to work on this issue at the moment.

IceSentry added a commit to IceSentry/bevy that referenced this issue Jul 27, 2021
ostwilkens pushed a commit to ostwilkens/bevy that referenced this issue Jul 27, 2021
I linked to examples within the rustdoc for the 2d examples as per issue bevyengine#1934
IceSentry added a commit to IceSentry/bevy that referenced this issue Jul 28, 2021
IceSentry added a commit to IceSentry/bevy that referenced this issue Jul 28, 2021
IceSentry added a commit to IceSentry/bevy that referenced this issue Jul 28, 2021
IceSentry added a commit to IceSentry/bevy that referenced this issue Jul 29, 2021
IceSentry added a commit to IceSentry/bevy that referenced this issue Aug 4, 2021
IceSentry added a commit to IceSentry/bevy that referenced this issue Aug 24, 2021
IceSentry added a commit to IceSentry/bevy that referenced this issue Aug 26, 2021
@alice-i-cecile
Copy link
Member Author

There's an exciting new nightly feature for this: https://twitter.com/wcrichton/status/1456112165744615426 !

@djeedai
Copy link
Contributor

djeedai commented Sep 17, 2022

Be sure to link to the latest branch of the examples, to avoid pointless churn on every release

Unfortunately that will produce dead links when e.g. some example is moved or renamed, because the link is not frozen to the version of the code it documents. I think this is understood and still the less worse solution, but just wanted to point it out explicitly.

bors bot pushed a commit that referenced this issue Sep 20, 2022
# Objective

Working on issue #1934 , with linking examples to the documentation. PR for transform examples.

## Solution

Added to the documentation in bevy_transform transform.rs and global_transform.rs utilizing links from examples.

[X] 3d_rotations.rs linked to rotate in Transform
[X] global_vs_local_translation.rs linked to top of Transform and GlobalTransform documentation
[X] scale.rs linked to scale Struct in Transform
[X] transform.rs linked to top of Transform documentation
[X] translation.rs linked to from_translation in Transform

Co-authored-by: bwhitt7 <103079612+bwhitt7@users.noreply.github.com>
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 19, 2022
# Objective

Working on issue bevyengine#1934 , with linking examples to the documentation. PR for transform examples.

## Solution

Added to the documentation in bevy_transform transform.rs and global_transform.rs utilizing links from examples.

[X] 3d_rotations.rs linked to rotate in Transform
[X] global_vs_local_translation.rs linked to top of Transform and GlobalTransform documentation
[X] scale.rs linked to scale Struct in Transform
[X] transform.rs linked to top of Transform documentation
[X] translation.rs linked to from_translation in Transform

Co-authored-by: bwhitt7 <103079612+bwhitt7@users.noreply.github.com>
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 28, 2022
# Objective

Working on issue bevyengine#1934 , with linking examples to the documentation. PR for transform examples.

## Solution

Added to the documentation in bevy_transform transform.rs and global_transform.rs utilizing links from examples.

[X] 3d_rotations.rs linked to rotate in Transform
[X] global_vs_local_translation.rs linked to top of Transform and GlobalTransform documentation
[X] scale.rs linked to scale Struct in Transform
[X] transform.rs linked to top of Transform documentation
[X] translation.rs linked to from_translation in Transform

Co-authored-by: bwhitt7 <103079612+bwhitt7@users.noreply.github.com>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

Working on issue bevyengine#1934 , with linking examples to the documentation. PR for transform examples.

## Solution

Added to the documentation in bevy_transform transform.rs and global_transform.rs utilizing links from examples.

[X] 3d_rotations.rs linked to rotate in Transform
[X] global_vs_local_translation.rs linked to top of Transform and GlobalTransform documentation
[X] scale.rs linked to scale Struct in Transform
[X] transform.rs linked to top of Transform documentation
[X] translation.rs linked to from_translation in Transform

Co-authored-by: bwhitt7 <103079612+bwhitt7@users.noreply.github.com>
@mockersf
Copy link
Member

mockersf commented Apr 1, 2024

done through example scrapping #9154

@mockersf mockersf closed this as completed Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Docs An addition or correction to our documentation C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

No branches or pull requests

4 participants