I have just finished a final project for my Rust class. The project works and runs pretty well. One of the requirements for this project was to include documentation using the /// doc comment that Rust uses. I have coded this entire project through Visual Studio Code 2.
I have made a view documentation comments using that format, but when I save the code and commit it to my GitHub, I cannot find any files on my GitHub that references what I have typed in my main Rust file.
/// The "CarryOn()" function is used for determining if the user wants to add more words to the glossary.
/// The user can input 1 to continue, or any other number to quit.
fn CarryOn()->i8{
println!("Do you want to continue ending words to the glossary?");
println!("Press 1 for yes, enter any other number for no.");
let mut s1 = String::new();
io::stdin().read_line(&mut s1).expect("Failed");
let n1:i8 = s1.trim().parse().expect("Not a valid Number");
return n1;
}
There's an example of the some of the documentation from my code. Where/how would I find the file, local or on my GitHub, that would show this documentation?
I am new with Rust, and after endlessly searching through YouTube, Google, and my class and teacher's notes, I could not find anything descriptive that would help me...
If you need your documentation to be hosted online, not just available on your local machine, then you can create a GitHub Pages repository. You can then run cargo doc
on your code to generate the ./target/doc
directory and copy the contents of that into your GitHub pages repository.
That's what I've done here: hosted documentation, pages repository, original code.