Documentation for library

Hi folks,

before publish my library I would like to generate the doc and edit it.
What I did is run the command:

cargo doc --no-deps

and after that I see no directory generated in my root directory. But it is possible to open this docs using:

cargo doc --open

Where can I find this directory and should I move it to my root directory ? And what should I do to add more description for my library: should I edit the file manually or probably I need to add the data into another way ?

Everything Cargo builds will be in the target/ directory per default. Your docs are in target/doc. You shouldn't make any manual changes to the generated files though, as running cargo doc the next time will override your changes. Adding documentation to your package should be done with doc comments inside of your source code. The tool that generates the documentation is called rustdoc and you can find its documentation here. The book also has a chapter on how to write documentation.

5 Likes

Thank you !

1 Like