diff --git a/src/doc/man/cargo-doc.md b/src/doc/man/cargo-doc.md index 20a9c2589d1..c97f13a0b83 100644 --- a/src/doc/man/cargo-doc.md +++ b/src/doc/man/cargo-doc.md @@ -22,7 +22,9 @@ is placed in `target/doc` in rustdoc's usual format. {{#option "`--open`" }} Open the docs in a browser after building them. This will use your default -browser unless you define another one in the `BROWSER` environment variable. +browser unless you define another one in the `BROWSER` environment variable +or use the [`doc.browser`](../reference/config.html#docbrowser) configuration +option. {{/option}} {{#option "`--no-deps`" }} diff --git a/src/doc/man/cargo-rustdoc.md b/src/doc/man/cargo-rustdoc.md index 958aa13c217..af5d6906ae2 100644 --- a/src/doc/man/cargo-rustdoc.md +++ b/src/doc/man/cargo-rustdoc.md @@ -34,7 +34,9 @@ or the `build.rustdocflags` [config value](../reference/config.html). {{#option "`--open`" }} Open the docs in a browser after building them. This will use your default -browser unless you define another one in the `BROWSER` environment variable. +browser unless you define another one in the `BROWSER` environment variable +or use the [`doc.browser`](../reference/config.html#docbrowser) configuration +option. {{/option}} {{/options}} diff --git a/src/doc/man/generated_txt/cargo-doc.txt b/src/doc/man/generated_txt/cargo-doc.txt index 8798744e50b..b81160f4406 100644 --- a/src/doc/man/generated_txt/cargo-doc.txt +++ b/src/doc/man/generated_txt/cargo-doc.txt @@ -15,7 +15,9 @@ OPTIONS --open Open the docs in a browser after building them. This will use your default browser unless you define another one in the BROWSER - environment variable. + environment variable or use the doc.browser + + configuration option. --no-deps Do not build documentation for dependencies. diff --git a/src/doc/man/generated_txt/cargo-rustdoc.txt b/src/doc/man/generated_txt/cargo-rustdoc.txt index 74c281554e7..d6161e79e2b 100644 --- a/src/doc/man/generated_txt/cargo-rustdoc.txt +++ b/src/doc/man/generated_txt/cargo-rustdoc.txt @@ -34,7 +34,9 @@ OPTIONS --open Open the docs in a browser after building them. This will use your default browser unless you define another one in the BROWSER - environment variable. + environment variable or use the doc.browser + + configuration option. Package Selection By default, the package in the current working directory is selected. diff --git a/src/doc/src/commands/cargo-doc.md b/src/doc/src/commands/cargo-doc.md index 7640416f9e1..413f7f48c11 100644 --- a/src/doc/src/commands/cargo-doc.md +++ b/src/doc/src/commands/cargo-doc.md @@ -22,7 +22,9 @@ is placed in `target/doc` in rustdoc's usual format.
--open
Open the docs in a browser after building them. This will use your default -browser unless you define another one in the BROWSER environment variable.
+browser unless you define another one in the BROWSER environment variable +or use the doc.browser configuration +option.
--no-deps
diff --git a/src/doc/src/commands/cargo-rustdoc.md b/src/doc/src/commands/cargo-rustdoc.md index cbd3db6e84e..b0b31cec6cc 100644 --- a/src/doc/src/commands/cargo-rustdoc.md +++ b/src/doc/src/commands/cargo-rustdoc.md @@ -38,7 +38,9 @@ or the `build.rustdocflags` [config value](../reference/config.html).
--open
Open the docs in a browser after building them. This will use your default -browser unless you define another one in the BROWSER environment variable.
+browser unless you define another one in the BROWSER environment variable +or use the doc.browser configuration +option. diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md index fd0818e464f..af11bb80b71 100644 --- a/src/doc/src/reference/config.md +++ b/src/doc/src/reference/config.md @@ -67,7 +67,7 @@ incremental = true # whether or not to enable incremental compilation dep-info-basedir = "…" # path for the base directory for targets in depfiles pipelining = true # rustc pipelining -[cargo-doc] +[doc] browser = "chromium" # browser to use with `cargo doc --open`, # overrides the `BROWSER` environment variable @@ -400,11 +400,11 @@ directory. Controls whether or not build pipelining is used. This allows Cargo to schedule overlapping invocations of `rustc` in parallel when possible. -#### `[cargo-doc]` +#### `[doc]` -The `[cargo-doc]` table defines options for the [`cargo doc`] command. +The `[doc]` table defines options for the [`cargo doc`] command. -##### `cargo-doc.browser` +##### `doc.browser` This option sets the browser to be used by [`cargo doc`], overriding the `BROWSER` environment variable when opening documentation with the `--open` diff --git a/src/doc/src/reference/environment-variables.md b/src/doc/src/reference/environment-variables.md index 7172b3d70e0..62625bc789a 100644 --- a/src/doc/src/reference/environment-variables.md +++ b/src/doc/src/reference/environment-variables.md @@ -52,7 +52,7 @@ system: detail. * `TERM` — If this is set to `dumb`, it disables the progress bar. * `BROWSER` — The web browser to execute to open documentation with [`cargo - doc`]'s' `--open` flag, see [`cargo-doc.browser`] for more details. + doc`]'s' `--open` flag, see [`doc.browser`] for more details. * `RUSTFMT` — Instead of running `rustfmt`, [`cargo fmt`](https://github.com/rust-lang/rustfmt) will execute this specified `rustfmt` instance instead. @@ -134,7 +134,7 @@ supported environment variables are: [`build.incremental`]: config.md#buildincremental [`build.dep-info-basedir`]: config.md#builddep-info-basedir [`build.pipelining`]: config.md#buildpipelining -[`cargo-doc.browser`]: config.md#cargo-docbrowser +[`doc.browser`]: config.md#docbrowser [`cargo-new.name`]: config.md#cargo-newname [`cargo-new.email`]: config.md#cargo-newemail [`cargo-new.vcs`]: config.md#cargo-newvcs diff --git a/src/etc/man/cargo-doc.1 b/src/etc/man/cargo-doc.1 index 36856d96868..cb700b2f870 100644 --- a/src/etc/man/cargo-doc.1 +++ b/src/etc/man/cargo-doc.1 @@ -16,7 +16,9 @@ is placed in \fBtarget/doc\fR in rustdoc's usual format. \fB\-\-open\fR .RS 4 Open the docs in a browser after building them. This will use your default -browser unless you define another one in the \fBBROWSER\fR environment variable. +browser unless you define another one in the \fBBROWSER\fR environment variable +or use the \fI\f(BIdoc.browser\fI\fR configuration +option. .RE .sp \fB\-\-no\-deps\fR diff --git a/src/etc/man/cargo-rustdoc.1 b/src/etc/man/cargo-rustdoc.1 index 2845cf9d632..7ff1b638da1 100644 --- a/src/etc/man/cargo-rustdoc.1 +++ b/src/etc/man/cargo-rustdoc.1 @@ -32,7 +32,9 @@ or the \fBbuild.rustdocflags\fR \fIconfig value\fR configuration +option. .RE .SS "Package Selection" By default, the package in the current working directory is selected. The \fB\-p\fR