LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

rustdoc

Generate documentation from Rust source code

TLDR

Generate documentation
$ rustdoc [lib.rs]
copy
Generate for crate
$ rustdoc --crate-name [mylib] [lib.rs]
copy
Output to directory
$ rustdoc -o [docs] [lib.rs]
copy
Document with tests
$ rustdoc --test [lib.rs]
copy
Set edition
$ rustdoc --edition [2021] [lib.rs]
copy

SYNOPSIS

rustdoc [options] input

DESCRIPTION

rustdoc generates HTML documentation from Rust source code and doc comments. It extracts specially-formatted comments and produces navigable API documentation.The tool is typically invoked via `cargo doc` rather than directly, but can be used for custom documentation needs.

PARAMETERS

--crate-name name

Crate name.
-o dir, --out-dir dir
Output directory.
--test
Run documentation tests.
--edition year
Rust edition.
-L path
Library search path.
--extern name=path
External crate.
--document-private-items
Include private items.
--html-in-header file
HTML to insert in header.
--markdown-css file
CSS for markdown.

INSTALL

sudo apt install rustc
copy
sudo dnf install rust
copy
sudo pacman -S rust
copy
sudo apk add rust
copy
sudo zypper install rust
copy
brew install rust
copy
nix profile install nixpkgs#rustc
copy

CAVEATS

Usually use cargo doc instead. Library paths needed for dependencies. Doc tests require proper setup. Private items hidden by default.

HISTORY

rustdoc has been part of Rust since early development. Documentation culture is strong in Rust, and rustdoc enables it with doc comments that compile to HTML and include tested code examples.

SEE ALSO

cargo(1), rustc(1), doxygen(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid