rust3ds / ctru-rs

Rust wrapper for libctru

Home Page:https://rust3ds.github.io/ctru-rs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

General documentation improvements

ian-h-chamberlain opened this issue · comments

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.

commented

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

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.

commented

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.

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

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.

commented

@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.

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.

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