Args

Type Alias Args 

Source
pub type Args = GenerateArgs;
Expand description

Backwards-compatible type alias for existing code.

Aliased Type§

pub struct Args {
    pub path: Option<PathBuf>,
    pub dir: Option<PathBuf>,
    pub mdbook: bool,
    pub search_index: bool,
    pub primary_crate: Option<String>,
    pub output: PathBuf,
    pub format: CliOutputFormat,
    pub exclude_private: bool,
    pub include_blanket_impls: bool,
}

Fields§

§path: Option<PathBuf>

Path to a local rustdoc JSON file.

Generate this file with: cargo doc --output-format json The JSON file will be in target/doc/{crate_name}.json

Mutually exclusive with --dir.

§dir: Option<PathBuf>

Directory containing multiple rustdoc JSON files.

Use this for multi-crate documentation generation. The tool will scan the directory for all *.json files (rustdoc format) and generate documentation for each crate with cross-crate linking.

Generate JSON files with: RUSTDOCFLAGS='-Z unstable-options --output-format json' cargo +nightly doc

Mutually exclusive with --path.

§mdbook: bool

Generate mdBook-compatible SUMMARY.md file.

Only valid with --dir for multi-crate documentation. Creates a SUMMARY.md file in the output directory that can be used as the entry point for an mdBook documentation site.

§search_index: bool

Generate search_index.json for client-side search.

Only valid with --dir for multi-crate documentation. Creates a search_index.json file containing all documented items, which can be used with client-side search libraries like Fuse.js, Lunr.js, or FlexSearch.

§primary_crate: Option<String>

Primary crate name for preferential link resolution.

When specified with --dir, links to items in this crate take precedence over items with the same name in dependencies. This helps resolve ambiguous links like exit to the intended crate rather than std::process::exit.

§output: PathBuf

Output directory for generated markdown files.

The directory will be created if it doesn’t exist. Defaults to generated_docs/ in the current directory.

§format: CliOutputFormat

Output format (flat or nested).

  • flat: All files in one directory
  • nested: Directory hierarchy mirroring modules (default)
§exclude_private: bool

Exclude private (non-public) items from the output.

By default, all items are documented including pub(crate), pub(super), and private items. Enable this to only include public items.

§include_blanket_impls: bool

Include blanket trait implementations in the output.

By default, blanket impls like From, Into, TryFrom, TryInto, Any, Borrow, BorrowMut, and ToOwned are filtered out to reduce noise. Enable this to include them in the documentation.