Expand description

What is rustdoc?

rustdoc is a tool to convert Rust code into documentation. It can be used standalone, but most likely you want to invoke it from cargo:

cargo doc --open

The above command generates the documentation and opens it in a browser.

Why rustdoc?

Most public code needs documentation on how to use it. While rustdoc can generate a lot of documentation by itself, it is still necessary for humans to provide additional information.

How to use rustdoc?

You add special documentation comments in your source code. If you want to write documentation for a module, you insert documentation lines that start with //! to describe the module file itself. You can check out how it is done for this module, by clicking on the link with the text “source” at the top right of the page.

Tell me more

Have a look at the codeblocks module.

Modules

Various living beings
Showing code examples with code blocks
Defining external examples
Create nice greatings.
Free documentation hosting on docs.rs
Markdown