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

Improve documentation and examples #134

Merged
merged 39 commits into from
Aug 6, 2023
Merged

Improve documentation and examples #134

merged 39 commits into from
Aug 6, 2023

Conversation

Meziu
Copy link
Member

@Meziu Meziu commented Jul 28, 2023

Closes #32

Finally, the long awaited "documentation PR" I have so much anticipated has come.

This PR's changes boil down to:

  • Newly written READMEs for each package (with the idea in mind that they will eventually be read from crates.io).
  • Changed Cargo.toml manifests to include all metadata required for a future release on crates.io.
  • Improved examples with the addition of a better documentation that explains their behavior (except for the "threads" and "futures" examples that still need to be settled).
  • A pretty substantial list of new TODOs that I discovered while thoroughly testing the crate (a lot of testing has been done...)
  • #[doc(alias)] for ALL functions and structs that benefit a 1:1 relation with ctru-sys, so that users used to the C library can search for names they already know and find out how that functionality translates in ctru-rs.
  • Slight bump to the minimum rust versions (the same as cargo-3ds).

And most importantly:

  • COMPLETE member-by-member documentation that includes multiple documentation layers, doclinks, and small doctests/examples for most functions.

I suggest you review this PR mostly by looking at the result of the cargo 3ds doc compilation, since the git diff is huge.

This PR took me weeks of work and it marks one big milestone for this project (in some cases, the new docs are actually better than libctru's official ones :P ).

Thanks for your attention. I may finally go puke in a nearby bucket. Writing docs is nauseous 🤮 .

@Meziu Meziu requested a review from a team as a code owner July 28, 2023 16:35
@FenrirWolf
Copy link
Member

When I check out the branch and run cargo 3ds doc --open, I get the following error from shim_3ds that prevents the docs from fully building:

error[E0432]: unresolved import `ctru_sys::__errno`
 --> /home/fenrir/.cargo/git/checkouts/shim-3ds-0fd8aff15f8f05f2/2d3ebe6/src/lib.rs:3:5
  |
3 | use ctru_sys::__errno;
  |     ^^^^^^^^^^-------
  |     |         |
  |     |         help: a similar name exists in the module: `errno`
  |     no `__errno` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `shim-3ds` (lib) due to previous error

@Meziu
Copy link
Member Author

Meziu commented Jul 28, 2023

When I check out the branch and run cargo 3ds doc --open, I get the following error from shim_3ds that prevents the docs from fully building:

error[E0432]: unresolved import `ctru_sys::__errno`
 --> /home/fenrir/.cargo/git/checkouts/shim-3ds-0fd8aff15f8f05f2/2d3ebe6/src/lib.rs:3:5
  |
3 | use ctru_sys::__errno;
  |     ^^^^^^^^^^-------
  |     |         |
  |     |         help: a similar name exists in the module: `errno`
  |     no `__errno` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `shim-3ds` (lib) due to previous error

You probably need to update your git cache. It’s been updated a while ago. cargo update should do the trick.

@FenrirWolf
Copy link
Member

That's the thing though, I can build and read the docs just fine on the latest master but not on this branch. Same thing after running cargo update too.

@Meziu
Copy link
Member Author

Meziu commented Jul 28, 2023

That's the thing though, I can build and read the docs just fine on the latest master but not on this branch. Same thing after running cargo update too.

I don’t really know what to tell you except cargo clean and cargo update. The function is very much there and even the CI (which uses a fresh environment) can build the documentation just fine.

@FenrirWolf
Copy link
Member

Got them building after nuking my local project and then checking the branch out again. Not sure what that was about but at least the problem's gone now 😆

@FenrirWolf
Copy link
Member

Other than typos and some suggestions from Github Actions that might be worth implementing, I'd say that this looks good to me

Copy link
Member

@FenrirWolf FenrirWolf 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 the things I saw from Github Actions weren't actually caused by this PR so they don't need to block it. I think this looks good to merge

Copy link
Contributor

@adryzz adryzz left a comment

Choose a reason for hiding this comment

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

great job! LGTM

Copy link
Member

@ian-h-chamberlain ian-h-chamberlain left a comment

Choose a reason for hiding this comment

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

Wow, awesome work!!! This is really a huge step forward for the library and looks like it took a lot of effort, so thank you!

Many of my comments are just little typos or minor wording change suggestions, so feel free to ignore them as you want. I probably missed some stuff but I tried to look at everything I could, so hopefully some of it is helpful.

This is really exciting!

ctru-rs/Cargo.toml Show resolved Hide resolved
ctru-rs/Cargo.toml Outdated Show resolved Hide resolved
ctru-rs/Cargo.toml Show resolved Hide resolved
ctru-rs/Cargo.toml Show resolved Hide resolved
ctru-sys/Cargo.toml Show resolved Hide resolved
ctru-rs/src/error.rs Outdated Show resolved Hide resolved
ctru-rs/src/lib.rs Show resolved Hide resolved
ctru-rs/src/lib.rs Show resolved Hide resolved
ctru-rs/src/lib.rs Show resolved Hide resolved
ctru-rs/src/mii.rs Outdated Show resolved Hide resolved
ian-h-chamberlain

This comment was marked as duplicate.

Meziu and others added 2 commits August 4, 2023 23:15
@Meziu Meziu merged commit 3e89922 into master Aug 6, 2023
@Meziu Meziu deleted the improve/docs branch August 6, 2023 20:59
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.

General documentation improvements
5 participants