Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

cargo-doc (1)

Name

cargo-doc - Build a package's documentation

Synopsis

cargo doc [OPTIONS]

Description

CARGO-DOC(1)                     Cargo Manual                     CARGO-DOC(1)



NAME
       cargo-doc - Build a package's documentation

SYNOPSIS
       cargo doc [OPTIONS]

DESCRIPTION
       Build a package's documentation.

       By default the documentation for the local package and all dependencies
       is built.  The output is all placed in 'target/doc' in rustdoc's  usual
       format.

       If  the --package argument is given, then SPEC is a package id specifi-
       cation which indicates which package should be built.   If  it  is  not
       given, then the current package is built.  For more information on SPEC
       and its format, see the "cargo help pkgid" command.

OPTIONS
       -h, --help
              Print this message.

       -p SPEC, --package SPEC ...
              Package to document.

       --open Opens the docs in a browser after the operation.

       --no-deps
              Don't build documentation for dependencies.

       -j N, --jobs N
              Number of parallel jobs, defaults to # of CPUs.

       --release
              Build artifacts in release mode, with optimizations.

       --features FEATURES
              Space-separated list of features to also build.

       --all-features
              Build all available features.

       --no-default-features
              Do not build the default feature.

       --target TRIPLE
              Build for the target triple.

       --manifest-path PATH
              Path to the Cargo.toml to compile.

       -v, --verbose
              Use verbose output.

       -q, --quiet
              No output printed to stdout.

       --color WHEN
              Coloring: auto, always, never.

EXAMPLES
       Build a local package documentation in 'target/doc'

              $ cargo doc


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+----------------------+
       |ATTRIBUTE TYPE |   ATTRIBUTE VALUE    |
       +---------------+----------------------+
       |Availability   | developer/rust/cargo |
       +---------------+----------------------+
       |Stability      | Volatile             |
       +---------------+----------------------+
SEE ALSO
       cargo(1), cargo-build(1)

COPYRIGHT
       This work is dual-licensed under Apache 2.0 and MIT terms.   See  COPY-
       RIGHT file in the cargo source distribution.



NOTES
       This software was built from source available at https://github.com/or-
       acle/solaris-userland.  The original community  source  was  downloaded
       from  https://static.rust-lang.org/dist/rustc-1.28.0-src.tar.xz

       Further information about this software can be found on the open source
       community website at http://www.rust-lang.org/.



The Rust package manager           May 2016                       CARGO-DOC(1)