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

General documentation improvements #32

Closed
ian-h-chamberlain opened this issue Jan 29, 2022 · 8 comments · Fixed by #134
Closed

General documentation improvements #32

ian-h-chamberlain opened this issue Jan 29, 2022 · 8 comments · Fixed by #134

Comments

@ian-h-chamberlain
Copy link
Member

ian-h-chamberlain commented Jan 29, 2022

Obviously, this library is still in early stages, and I don't expect there to be a ton of documentation at this point, but I think having good docs will be important for users and others looking to contribute.

A couple points I can think of right off the bat:

  • Use rustdoc lints to check for missing docstrings and fix where relevant
  • Investigate removing --no-doc-comments from bindgen.sh. There seem to be a pretty decent amount of doc comments in libctru, so having these readily available in Rust might be nice, even if they're written in a different format than rustdoc expects.
  • Doctests? Unfortunately not much of a possibility for this library, although we might be able to use no_run and at least verify examples compile.
  • Simply write docstrings for new code as it comes along. This alone will probably help a lot.

Long-term, if the crates are published to crates.io and then we can get nice docs on docs.rs! I have already been using cargo 3ds doc a bit to start out, with some success.

Edit: command to check doc lints looks like

cargo 3ds rustdoc -- -W rustdoc::all

Although that is a bit heavy handed – we may not want all lints in the end.

@Meziu
Copy link
Member

Meziu commented Jan 29, 2022

Yeah, this is a good thing to keep in mind for the future of the crate.

@Techie-Pi
Copy link
Member

Maybe this is somewhat off-topic, but I think it would be a good idea to generate and publish the Rustdocs of ctru-rs to GitHub Pages on push, that way is more accesible to users of the library. Example of a workflow that does this.

@Meziu
Copy link
Member

Meziu commented Oct 9, 2022

Maybe this is somewhat off-topic, but I think it would be a good idea to generate and publish the Rustdocs of ctru-rs to GitHub Pages on push, that way is more accesible to users of the library. Example of a workflow that does this.

I don't feel the need to do that. Once the crates get published (which I hope will coincide with the merge of the thread-related features) crates.io will handle the documentation hosting.

@Techie-Pi
Copy link
Member

the crates get published (which I hope will coincide with the merge of the thread-related features)

In that case, you're right, that won't be needed

@PeCoBe
Copy link

PeCoBe commented Oct 24, 2022

Hi, I just found this project, I dont have much experience in Rust, and also just started my into 3DS cfw development.
Is there documentation on how to setup the rust 3ds dev environment? I have been trying, but there really no much documentation about it, and I have been unsuccessful.

@Meziu
Copy link
Member

Meziu commented Oct 24, 2022

@PeCoBe I don’t know if I ever fully wrote it somewhere, but here it is:

  • Make sure you’ve installed the devkitARM toolchain with all packages
  • Export these environment variables (put them in a .bashrc or similar):
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=$DEVKITPRO/devkitARM
  • Install the latest Rust nightly version (and use it for all further operations)
  • Install our cargo-3ds tool (using cargo install)
  • Now, you can either make your own project or run one of our examples in ctru-rs. Just use the command cargo 3ds run. For running an example, do cargo 3ds run —example [example name]

Without some knowledge of the Rust toolchain (or the devkitPRO one) it might be difficult to solve any issues, but this is more or less what you need to do.

Also, if you have little knowledge about writing custom homebrew, I suggest using the standard C toolchain by devkitPRO and play around with it. Our toolchain is far from finished or stable.

@PeCoBe
Copy link

PeCoBe commented Oct 24, 2022

Thanks. Yeah Im want to start with devkitpro first, but found this I tought hey lets give it a try.
I think I was able to setup all, but having this error
Compiling ctru-sys v0.4.1 (D:\Documents\Git\Rust3DS\ctru-rs\ctru-sys) error: could not find native static libraryctrud, perhaps an -L flag is missing?

anyway, thanks, I will keep an eye on this project.

@Techie-Pi
Copy link
Member

Looks like we should add a guide about setting up a dev environment

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 a pull request may close this issue.

4 participants