diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 85589469101..69ab5b41caf 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -23,6 +23,7 @@ jobs:
- run: cd crates/crates-io && cargo fmt --all -- --check
- run: cd crates/resolver-tests && cargo fmt --all -- --check
- run: cd crates/cargo-platform && cargo fmt --all -- --check
+ - run: cd crates/mdman && cargo fmt --all -- --check
test:
runs-on: ${{ matrix.os }}
@@ -65,6 +66,7 @@ jobs:
- run: cargo test --features 'deny-warnings'
- run: cargo test --features 'deny-warnings' -p cargo-test-support
- run: cargo test -p cargo-platform
+ - run: cargo test --manifest-path crates/mdman/Cargo.toml
resolver:
runs-on: ubuntu-latest
@@ -89,6 +91,7 @@ jobs:
- uses: actions/checkout@v2
- run: rustup update nightly && rustup default nightly
- run: rustup component add rust-docs
+ - run: ci/validate-man.sh
- run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.3.7/mdbook-v0.3.7-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
diff --git a/ci/validate-man.sh b/ci/validate-man.sh
new file mode 100755
index 00000000000..293da7e4cfe
--- /dev/null
+++ b/ci/validate-man.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+# This script validates that there aren't any changes to the man pages.
+
+set -e
+
+cd src/doc
+
+changes=$(git status --porcelain .)
+if [ -n "$changes" ]
+then
+ echo "git directory must be clean before running this script."
+ exit 1
+fi
+
+./build-man.sh
+
+changes=$(git status --porcelain .)
+if [ -n "$changes" ]
+then
+ echo "Detected changes in man pages:"
+ echo "$changes"
+ echo
+ echo "Please run './build-man.sh' in the src/doc directory to rebuild the"
+ echo "man pages, and commit the changes."
+ exit 1
+fi
diff --git a/crates/mdman/Cargo.lock b/crates/mdman/Cargo.lock
new file mode 100644
index 00000000000..124750d9d51
--- /dev/null
+++ b/crates/mdman/Cargo.lock
@@ -0,0 +1,449 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ansi_term"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "anyhow"
+version = "1.0.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b"
+
+[[package]]
+name = "bitflags"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
+
+[[package]]
+name = "block-buffer"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
+dependencies = [
+ "block-padding",
+ "byte-tools",
+ "byteorder",
+ "generic-array",
+]
+
+[[package]]
+name = "block-padding"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
+dependencies = [
+ "byte-tools",
+]
+
+[[package]]
+name = "byte-tools"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
+
+[[package]]
+name = "byteorder"
+version = "1.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
+
+[[package]]
+name = "cfg-if"
+version = "0.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
+
+[[package]]
+name = "ctor"
+version = "0.1.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "39858aa5bac06462d4dd4b9164848eb81ffc4aa5c479746393598fd193afa227"
+dependencies = [
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "difference"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
+
+[[package]]
+name = "digest"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
+name = "fake-simd"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
+
+[[package]]
+name = "generic-array"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
+dependencies = [
+ "typenum",
+]
+
+[[package]]
+name = "handlebars"
+version = "3.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "86dbc8a0746b08f363d2e00da48e6c9ceb75c198ac692d2715fcbb5bee74c87d"
+dependencies = [
+ "log",
+ "pest",
+ "pest_derive",
+ "quick-error",
+ "serde",
+ "serde_json",
+ "walkdir",
+]
+
+[[package]]
+name = "idna"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9"
+dependencies = [
+ "matches",
+ "unicode-bidi",
+ "unicode-normalization",
+]
+
+[[package]]
+name = "itoa"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
+
+[[package]]
+name = "log"
+version = "0.4.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "maplit"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
+
+[[package]]
+name = "matches"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
+
+[[package]]
+name = "mdman"
+version = "0.1.0"
+dependencies = [
+ "anyhow",
+ "handlebars",
+ "pretty_assertions",
+ "pulldown-cmark",
+ "same-file",
+ "serde_json",
+ "url",
+]
+
+[[package]]
+name = "memchr"
+version = "2.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
+
+[[package]]
+name = "opaque-debug"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
+
+[[package]]
+name = "output_vt100"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "percent-encoding"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
+
+[[package]]
+name = "pest"
+version = "2.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53"
+dependencies = [
+ "ucd-trie",
+]
+
+[[package]]
+name = "pest_derive"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0"
+dependencies = [
+ "pest",
+ "pest_generator",
+]
+
+[[package]]
+name = "pest_generator"
+version = "2.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55"
+dependencies = [
+ "pest",
+ "pest_meta",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "pest_meta"
+version = "2.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d"
+dependencies = [
+ "maplit",
+ "pest",
+ "sha-1",
+]
+
+[[package]]
+name = "pretty_assertions"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427"
+dependencies = [
+ "ansi_term",
+ "ctor",
+ "difference",
+ "output_vt100",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12"
+dependencies = [
+ "unicode-xid",
+]
+
+[[package]]
+name = "pulldown-cmark"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca36dea94d187597e104a5c8e4b07576a8a45aa5db48a65e12940d3eb7461f55"
+dependencies = [
+ "bitflags",
+ "memchr",
+ "unicase",
+]
+
+[[package]]
+name = "quick-error"
+version = "1.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
+
+[[package]]
+name = "quote"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "ryu"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
+
+[[package]]
+name = "same-file"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "serde"
+version = "1.0.114"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3"
+
+[[package]]
+name = "serde_json"
+version = "1.0.57"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "sha-1"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df"
+dependencies = [
+ "block-buffer",
+ "digest",
+ "fake-simd",
+ "opaque-debug",
+]
+
+[[package]]
+name = "syn"
+version = "1.0.36"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-xid",
+]
+
+[[package]]
+name = "tinyvec"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed"
+
+[[package]]
+name = "typenum"
+version = "1.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
+
+[[package]]
+name = "ucd-trie"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
+
+[[package]]
+name = "unicase"
+version = "2.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
+dependencies = [
+ "version_check",
+]
+
+[[package]]
+name = "unicode-bidi"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
+dependencies = [
+ "matches",
+]
+
+[[package]]
+name = "unicode-normalization"
+version = "0.1.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977"
+dependencies = [
+ "tinyvec",
+]
+
+[[package]]
+name = "unicode-xid"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
+
+[[package]]
+name = "url"
+version = "2.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb"
+dependencies = [
+ "idna",
+ "matches",
+ "percent-encoding",
+]
+
+[[package]]
+name = "version_check"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
+
+[[package]]
+name = "walkdir"
+version = "2.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
+dependencies = [
+ "same-file",
+ "winapi",
+ "winapi-util",
+]
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-util"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
diff --git a/crates/mdman/Cargo.toml b/crates/mdman/Cargo.toml
new file mode 100644
index 00000000000..9d4329a16f8
--- /dev/null
+++ b/crates/mdman/Cargo.toml
@@ -0,0 +1,18 @@
+[package]
+name = "mdman"
+version = "0.1.0"
+authors = ["Eric Huss"]
+edition = "2018"
+license = "MIT OR Apache-2.0"
+description = "Creates a man page page from markdown."
+
+[dependencies]
+anyhow = "1.0.31"
+handlebars = { version = "3.2.1", features = ["dir_source"] }
+pulldown-cmark = { version = "0.7.2", default-features = false }
+same-file = "1.0.6"
+serde_json = "1.0.56"
+url = "2.1.1"
+
+[dev-dependencies]
+pretty_assertions = "0.6.1"
diff --git a/crates/mdman/README.md b/crates/mdman/README.md
new file mode 100644
index 00000000000..e28b596ba34
--- /dev/null
+++ b/crates/mdman/README.md
@@ -0,0 +1,7 @@
+# mdman
+
+mdman is a small utility for creating man pages from markdown text files.
+
+## Usage
+
+See the [man page](doc/out/mdman.md) generated by this tool.
diff --git a/crates/mdman/build-man.sh b/crates/mdman/build-man.sh
new file mode 100755
index 00000000000..9286b17c2f1
--- /dev/null
+++ b/crates/mdman/build-man.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+
+cargo run -- -t md -o doc/out doc/*.md
+cargo run -- -t txt -o doc/out doc/*.md
+cargo run -- -t man -o doc/out doc/*.md
diff --git a/crates/mdman/doc/mdman.md b/crates/mdman/doc/mdman.md
new file mode 100644
index 00000000000..30d07139be2
--- /dev/null
+++ b/crates/mdman/doc/mdman.md
@@ -0,0 +1,95 @@
+# mdman(1)
+
+## NAME
+
+mdman - Converts markdown to a man page
+
+## SYNOPSIS
+
+`mdman` [_options_] `-t` _type_ `-o` _outdir_ _sources..._
+
+## DESCRIPTION
+
+Converts a markdown file to a man page.
+
+The source file is first processed as a
+[handlebars](https://handlebarsjs.com/) template. Then, it is processed as
+markdown into the target format. This supports different output formats,
+such as troff or plain text.
+
+Every man page should start with a level-1 header with the man name and
+section, such as `# mdman(1)`.
+
+The handlebars template has several special tags to assist with generating the
+man page:
+
+{{{{raw}}}}
+- Every block of command-line options must be wrapped between `{{#options}}`
+ and `{{/options}}` tags. This tells the processor where the options start
+ and end.
+- Each option must be expressed with a `{{#option}}` block. The parameters to
+ the the block are a sequence of strings indicating the option. For example,
+ ```{{#option "`-p` _spec_..." "`--package` _spec_..."}}``` is an option that
+ has two different forms. The text within the string is processed as markdown.
+ It is recommended to use formatting similar to this example.
+
+ The content of the `{{#option}}` block should contain a detailed description
+ of the option.
+
+ Use the `{{/option}}` tag to end the option block.
+- References to other man pages should use the `{{man name section}}`
+ expression. For example, `{{man "mdman" 1}}` will generate a reference to
+ the `mdman(1)` man page. For non-troff output, the `--man` option will tell
+ `mdman` how to create links to the man page. If there is no matching `--man`
+ option, then it links to a file named _name_`.md` in the same directory.
+- Variables can be set with `{{*set name="value"}}`. These variables can
+ then be referenced with `{{name}}` expressions.
+- Partial templates should be placed in a directory named `includes`
+ next to the source file. Templates can be included with an expression like
+ `{{> template-name}}`.
+- Other helpers include:
+ - `{{lower value}}` Converts the given value to lowercase.
+{{{{/raw}}}}
+
+## OPTIONS
+
+{{#options}}
+
+{{#option "`-t` _type_"}}
+Specifies the output type. The following output types are supported:
+- `man` — A troff-style man page. Outputs with a numbered extension (like
+ `.1`) matching the man page section.
+- `md` — A markdown file, after all handlebars processing has been finished.
+ Outputs with the `.md` extension.
+- `txt` — A text file, rendered for situations where a man page viewer isn't
+ available. Outputs with the `.txt` extension.
+{{/option}}
+
+{{#option "`-o` _outdir_"}}
+Specifies the directory where to save the output.
+{{/option}}
+
+{{#option "`--url` _base_url_"}}
+Specifies a base URL to use for relative URLs within the document. Any
+relative URL will be joined with this URL.
+{{/option}}
+
+{{#option "`--man` _name_`:`_section_`=`_url_"}}
+Specifies a URL to use for the given man page. When the `\{{man name
+section}}` expression is used, the given URL will be inserted as a link. This
+may be specified multiple times. If a man page reference does not have a
+matching `--man` entry, then a relative link to a file named _name_`.md` will
+be used.
+{{/option}}
+
+{{#option "_sources..._"}}
+The source input filename, may be specified multiple times.
+{{/option}}
+
+{{/options}}
+
+## EXAMPLES
+
+1. Convert the given documents to man pages:
+
+ mdman -t man -o doc doc/mdman.md
diff --git a/crates/mdman/doc/out/mdman.1 b/crates/mdman/doc/out/mdman.1
new file mode 100644
index 00000000000..c3a626d2510
--- /dev/null
+++ b/crates/mdman/doc/out/mdman.1
@@ -0,0 +1,124 @@
+'\" t
+.TH "MDMAN" "1"
+.nh
+.ad l
+.ss \n[.ss] 0
+.SH "NAME"
+mdman \- Converts markdown to a man page
+.SH "SYNOPSIS"
+\fBmdman\fR [\fIoptions\fR] \fB\-t\fR \fItype\fR \fB\-o\fR \fIoutdir\fR \fIsources...\fR
+.SH "DESCRIPTION"
+Converts a markdown file to a man page.
+.sp
+The source file is first processed as a
+\fIhandlebars\fR template. Then, it is processed as
+markdown into the target format. This supports different output formats,
+such as troff or plain text.
+.sp
+Every man page should start with a level\-1 header with the man name and
+section, such as \fB# mdman(1)\fR\&.
+.sp
+The handlebars template has several special tags to assist with generating the
+man page:
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Every block of command\-line options must be wrapped between \fB{{#options}}\fR
+and \fB{{/options}}\fR tags. This tells the processor where the options start
+and end.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Each option must be expressed with a \fB{{#option}}\fR block. The parameters to
+the the block are a sequence of strings indicating the option. For example,
+\fB{{#option "`\-p` _spec_..." "`\-\-package` _spec_..."}}\fR is an option that
+has two different forms. The text within the string is processed as markdown.
+It is recommended to use formatting similar to this example.
+.sp
+The content of the \fB{{#option}}\fR block should contain a detailed description
+of the option.
+.sp
+Use the \fB{{/option}}\fR tag to end the option block.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'References to other man pages should use the \fB{{man name section}}\fR
+expression. For example, \fB{{man "mdman" 1}}\fR will generate a reference to
+the \fBmdman(1)\fR man page. For non\-troff output, the \fB\-\-man\fR option will tell
+\fBmdman\fR how to create links to the man page. If there is no matching \fB\-\-man\fR
+option, then it links to a file named \fIname\fR\fB\&.md\fR in the same directory.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Variables can be set with \fB{{*set name="value"}}\fR\&. These variables can
+then be referenced with \fB{{name}}\fR expressions.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Partial templates should be placed in a directory named \fBincludes\fR
+next to the source file. Templates can be included with an expression like
+\fB{{> template\-name}}\fR\&.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Other helpers include:
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'\fB{{lower value}}\fR Converts the given value to lowercase.
+.RE
+.RE
+.SH "OPTIONS"
+.sp
+\fB\-t\fR \fItype\fR
+.RS 4
+Specifies the output type. The following output types are supported:
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'\fBman\fR \[em]\ A troff\-style man page. Outputs with a numbered extension (like
+\fB\&.1\fR) matching the man page section.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'\fBmd\fR \[em]\ A markdown file, after all handlebars processing has been finished.
+Outputs with the \fB\&.md\fR extension.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'\fBtxt\fR \[em]\ A text file, rendered for situations where a man page viewer isn't
+available. Outputs with the \fB\&.txt\fR extension.
+.RE
+.RE
+.sp
+\fB\-o\fR \fIoutdir\fR
+.RS 4
+Specifies the directory where to save the output.
+.RE
+.sp
+\fB\-\-url\fR \fIbase_url\fR
+.RS 4
+Specifies a base URL to use for relative URLs within the document. Any
+relative URL will be joined with this URL.
+.RE
+.sp
+\fB\-\-man\fR \fIname\fR\fB:\fR\fIsection\fR\fB=\fR\fIurl\fR
+.RS 4
+Specifies a URL to use for the given man page. When the \fB{{man name section}}\fR expression is used, the given URL will be inserted as a link. This
+may be specified multiple times. If a man page reference does not have a
+matching \fB\-\-man\fR entry, then a relative link to a file named \fIname\fR\fB\&.md\fR will
+be used.
+.RE
+.sp
+\fIsources...\fR
+.RS 4
+The source input filename, may be specified multiple times.
+.RE
+.SH "EXAMPLES"
+.sp
+.RS 4
+\h'-04' 1.\h'+01'Convert the given documents to man pages:
+.sp
+.RS 4
+.nf
+mdman \-t man \-o doc doc/mdman.md
+.fi
+.RE
+.RE
diff --git a/crates/mdman/doc/out/mdman.md b/crates/mdman/doc/out/mdman.md
new file mode 100644
index 00000000000..47b2b625d28
--- /dev/null
+++ b/crates/mdman/doc/out/mdman.md
@@ -0,0 +1,95 @@
+# mdman(1)
+
+## NAME
+
+mdman - Converts markdown to a man page
+
+## SYNOPSIS
+
+`mdman` [_options_] `-t` _type_ `-o` _outdir_ _sources..._
+
+## DESCRIPTION
+
+Converts a markdown file to a man page.
+
+The source file is first processed as a
+[handlebars](https://handlebarsjs.com/) template. Then, it is processed as
+markdown into the target format. This supports different output formats,
+such as troff or plain text.
+
+Every man page should start with a level-1 header with the man name and
+section, such as `# mdman(1)`.
+
+The handlebars template has several special tags to assist with generating the
+man page:
+
+- Every block of command-line options must be wrapped between `{{#options}}`
+ and `{{/options}}` tags. This tells the processor where the options start
+ and end.
+- Each option must be expressed with a `{{#option}}` block. The parameters to
+ the the block are a sequence of strings indicating the option. For example,
+ ```{{#option "`-p` _spec_..." "`--package` _spec_..."}}``` is an option that
+ has two different forms. The text within the string is processed as markdown.
+ It is recommended to use formatting similar to this example.
+
+ The content of the `{{#option}}` block should contain a detailed description
+ of the option.
+
+ Use the `{{/option}}` tag to end the option block.
+- References to other man pages should use the `{{man name section}}`
+ expression. For example, `{{man "mdman" 1}}` will generate a reference to
+ the `mdman(1)` man page. For non-troff output, the `--man` option will tell
+ `mdman` how to create links to the man page. If there is no matching `--man`
+ option, then it links to a file named _name_`.md` in the same directory.
+- Variables can be set with `{{*set name="value"}}`. These variables can
+ then be referenced with `{{name}}` expressions.
+- Partial templates should be placed in a directory named `includes`
+ next to the source file. Templates can be included with an expression like
+ `{{> template-name}}`.
+- Other helpers include:
+ - `{{lower value}}` Converts the given value to lowercase.
+
+
+## OPTIONS
+
+
+
+-t
type
+Specifies the output type. The following output types are supported:
+
+man
— A troff-style man page. Outputs with a numbered extension (like
+.1
) matching the man page section.
+md
— A markdown file, after all handlebars processing has been finished.
+Outputs with the .md
extension.
+txt
— A text file, rendered for situations where a man page viewer isn't
+available. Outputs with the .txt
extension.
+
+
+
+-o
outdir
+Specifies the directory where to save the output.
+
+
+--url
base_url
+Specifies a base URL to use for relative URLs within the document. Any
+relative URL will be joined with this URL.
+
+
+--man
name :
section =
url
+Specifies a URL to use for the given man page. When the {{man name section}}
expression is used, the given URL will be inserted as a link. This
+may be specified multiple times. If a man page reference does not have a
+matching --man
entry, then a relative link to a file named name .md
will
+be used.
+
+
+sources...
+The source input filename, may be specified multiple times.
+
+
+
+
+## EXAMPLES
+
+1. Convert the given documents to man pages:
+
+ mdman -t man -o doc doc/mdman.md
diff --git a/crates/mdman/doc/out/mdman.txt b/crates/mdman/doc/out/mdman.txt
new file mode 100644
index 00000000000..b6911bf4c64
--- /dev/null
+++ b/crates/mdman/doc/out/mdman.txt
@@ -0,0 +1,91 @@
+MDMAN(1)
+
+NAME
+ mdman - Converts markdown to a man page
+
+SYNOPSIS
+ mdman [options] -t type -o outdir sources...
+
+DESCRIPTION
+ Converts a markdown file to a man page.
+
+ The source file is first processed as a handlebars
+ template. Then, it is processed as markdown
+ into the target format. This supports different output formats, such as
+ troff or plain text.
+
+ Every man page should start with a level-1 header with the man name and
+ section, such as # mdman(1).
+
+ The handlebars template has several special tags to assist with
+ generating the man page:
+
+ o Every block of command-line options must be wrapped between
+ {{#options}} and {{/options}} tags. This tells the processor where
+ the options start and end.
+
+ o Each option must be expressed with a {{#option}} block. The
+ parameters to the the block are a sequence of strings indicating the
+ option. For example, {{#option "`-p` _spec_..." "`--package`
+ _spec_..."}} is an option that has two different forms. The text
+ within the string is processed as markdown. It is recommended to use
+ formatting similar to this example.
+
+ The content of the {{#option}} block should contain a detailed
+ description of the option.
+
+ Use the {{/option}} tag to end the option block.
+
+ o References to other man pages should use the {{man name section}}
+ expression. For example, {{man "mdman" 1}} will generate a reference
+ to the mdman(1) man page. For non-troff output, the --man option will
+ tell mdman how to create links to the man page. If there is no
+ matching --man option, then it links to a file named name.md in the
+ same directory.
+
+ o Variables can be set with {{*set name="value"}}. These variables can
+ then be referenced with {{name}} expressions.
+
+ o Partial templates should be placed in a directory named includes next
+ to the source file. Templates can be included with an expression like
+ {{> template-name}}.
+
+ o Other helpers include:
+
+ o {{lower value}} Converts the given value to lowercase.
+
+OPTIONS
+ -t type
+ Specifies the output type. The following output types are supported:
+
+ o man — A troff-style man page. Outputs with a numbered
+ extension (like .1) matching the man page section.
+
+ o md — A markdown file, after all handlebars processing has been
+ finished. Outputs with the .md extension.
+
+ o txt — A text file, rendered for situations where a man page
+ viewer isn't available. Outputs with the .txt extension.
+
+ -o outdir
+ Specifies the directory where to save the output.
+
+ --url base_url
+ Specifies a base URL to use for relative URLs within the document.
+ Any relative URL will be joined with this URL.
+
+ --man name:section=url
+ Specifies a URL to use for the given man page. When the {{man name
+ section}} expression is used, the given URL will be inserted as a
+ link. This may be specified multiple times. If a man page reference
+ does not have a matching --man entry, then a relative link to a file
+ named name.md will be used.
+
+ sources...
+ The source input filename, may be specified multiple times.
+
+EXAMPLES
+ 1. Convert the given documents to man pages:
+
+ mdman -t man -o doc doc/mdman.md
+
diff --git a/crates/mdman/src/format.rs b/crates/mdman/src/format.rs
new file mode 100644
index 00000000000..7bc9781b907
--- /dev/null
+++ b/crates/mdman/src/format.rs
@@ -0,0 +1,20 @@
+use anyhow::Error;
+
+pub mod man;
+pub mod md;
+pub mod text;
+
+pub trait Formatter {
+ /// Renders the given markdown to the formatter's output.
+ fn render(&self, input: &str) -> Result;
+ /// Renders the start of a block of options (triggered by `{{#options}}`).
+ fn render_options_start(&self) -> &'static str;
+ /// Renders the end of a block of options (triggered by `{{/options}}`).
+ fn render_options_end(&self) -> &'static str;
+ /// Renders an option (triggered by `{{#option}}`).
+ fn render_option(&self, params: &[&str], block: &str, man_name: &str) -> Result;
+ /// Converts a man page reference into markdown that is appropriate for this format.
+ ///
+ /// Triggered by `{{man name section}}`.
+ fn linkify_man_to_md(&self, name: &str, section: u8) -> Result;
+}
diff --git a/crates/mdman/src/format/man.rs b/crates/mdman/src/format/man.rs
new file mode 100644
index 00000000000..1962be2fe55
--- /dev/null
+++ b/crates/mdman/src/format/man.rs
@@ -0,0 +1,430 @@
+//! Man-page formatter.
+
+use crate::util::{header_text, parse_name_and_section};
+use crate::EventIter;
+use anyhow::{bail, Error};
+use pulldown_cmark::{Alignment, Event, LinkType, Tag};
+use std::fmt::Write;
+use url::Url;
+
+pub struct ManFormatter {
+ url: Option,
+}
+
+impl ManFormatter {
+ pub fn new(url: Option) -> ManFormatter {
+ ManFormatter { url }
+ }
+}
+
+impl super::Formatter for ManFormatter {
+ fn render(&self, input: &str) -> Result {
+ ManRenderer::render(input, self.url.clone())
+ }
+
+ fn render_options_start(&self) -> &'static str {
+ // Tell pulldown_cmark to ignore this.
+ // This will be stripped out later.
+ " &'static str {
+ "]]>"
+ }
+
+ fn render_option(
+ &self,
+ params: &[&str],
+ block: &str,
+ _man_name: &str,
+ ) -> Result {
+ let rendered_options = params
+ .iter()
+ .map(|param| {
+ let r = self.render(param)?;
+ Ok(r.trim().trim_start_matches(".sp").to_string())
+ })
+ .collect::, Error>>()?;
+ let rendered_block = self.render(block)?;
+ let rendered_block = rendered_block.trim().trim_start_matches(".sp").trim();
+ // .RS = move left margin to right 4.
+ // .RE = move margin back one level.
+ Ok(format!(
+ "\n.sp\n{}\n.RS 4\n{}\n.RE\n",
+ rendered_options.join(", "),
+ rendered_block
+ ))
+ }
+
+ fn linkify_man_to_md(&self, name: &str, section: u8) -> Result {
+ Ok(format!("`{}`({})", name, section))
+ }
+}
+
+#[derive(Copy, Clone)]
+enum Font {
+ Bold,
+ Italic,
+}
+
+impl Font {
+ fn str_from_stack(font_stack: &[Font]) -> &'static str {
+ let has_bold = font_stack.iter().any(|font| matches!(font, Font::Bold));
+ let has_italic = font_stack.iter().any(|font| matches!(font, Font::Italic));
+ match (has_bold, has_italic) {
+ (false, false) => "\\fR", // roman (normal)
+ (false, true) => "\\fI", // italic
+ (true, false) => "\\fB", // bold
+ (true, true) => "\\f(BI", // bold italic
+ }
+ }
+}
+
+struct ManRenderer<'e> {
+ output: String,
+ parser: EventIter<'e>,
+ font_stack: Vec,
+}
+
+impl<'e> ManRenderer<'e> {
+ fn render(input: &str, url: Option) -> Result {
+ let parser = crate::md_parser(input, url);
+ let output = String::with_capacity(input.len() * 3 / 2);
+ let mut mr = ManRenderer {
+ parser,
+ output,
+ font_stack: Vec::new(),
+ };
+ mr.push_man()?;
+ Ok(mr.output)
+ }
+
+ fn push_man(&mut self) -> Result<(), Error> {
+ // If this is true, this is inside a cdata block used for hiding
+ // content from pulldown_cmark.
+ let mut in_cdata = false;
+ // The current list stack. None if unordered, Some if ordered with the
+ // given number as the current index.
+ let mut list: Vec> = Vec::new();
+ // Used in some cases where spacing isn't desired.
+ let mut suppress_paragraph = false;
+ let mut table_cell_index = 0;
+
+ while let Some((event, range)) = self.parser.next() {
+ let this_suppress_paragraph = suppress_paragraph;
+ suppress_paragraph = false;
+ match event {
+ Event::Start(tag) => {
+ match tag {
+ Tag::Paragraph => {
+ if !this_suppress_paragraph {
+ self.flush();
+ self.output.push_str(".sp\n");
+ }
+ }
+ Tag::Heading(n) => {
+ if n == 1 {
+ self.push_top_header()?;
+ } else if n == 2 {
+ // Section header
+ let text = header_text(&mut self.parser)?;
+ self.flush();
+ write!(self.output, ".SH \"{}\"\n", text)?;
+ suppress_paragraph = true;
+ } else {
+ // Subsection header
+ let text = header_text(&mut self.parser)?;
+ self.flush();
+ write!(self.output, ".SS \"{}\"\n", text)?;
+ suppress_paragraph = true;
+ }
+ }
+ Tag::BlockQuote => {
+ self.flush();
+ // .RS = move left margin over 3
+ // .ll = shrink line length
+ self.output.push_str(".RS 3\n.ll -5\n.sp\n");
+ suppress_paragraph = true;
+ }
+ Tag::CodeBlock(_kind) => {
+ // space down, indent 4, no-fill mode
+ self.flush();
+ self.output.push_str(".sp\n.RS 4\n.nf\n");
+ }
+ Tag::List(start) => list.push(start),
+ Tag::Item => {
+ // Note: This uses explicit movement instead of .IP
+ // because the spacing on .IP looks weird to me.
+ // space down, indent 4
+ self.flush();
+ self.output.push_str(".sp\n.RS 4\n");
+ match list.last_mut().expect("item must have list start") {
+ // Ordered list.
+ Some(n) => {
+ // move left 4, output the list index number, move right 1.
+ write!(self.output, "\\h'-04' {}.\\h'+01'", n)?;
+ *n += 1;
+ }
+ // Unordered list.
+ None => self.output.push_str("\\h'-04'\\(bu\\h'+02'"),
+ }
+ suppress_paragraph = true;
+ }
+ Tag::FootnoteDefinition(_label) => unimplemented!(),
+ Tag::Table(alignment) => {
+ // Table start
+ // allbox = draw a box around all the cells
+ // tab(:) = Use `:` to separate cell data (instead of tab)
+ // ; = end of options
+ self.output.push_str(
+ "\n.TS\n\
+ allbox tab(:);\n",
+ );
+ let alignments: Vec<_> = alignment
+ .iter()
+ .map(|a| match a {
+ Alignment::Left | Alignment::None => "lt",
+ Alignment::Center => "ct",
+ Alignment::Right => "rt",
+ })
+ .collect();
+ self.output.push_str(&alignments.join(" "));
+ self.output.push_str(".\n");
+ table_cell_index = 0;
+ }
+ Tag::TableHead => {
+ table_cell_index = 0;
+ }
+ Tag::TableRow => {
+ table_cell_index = 0;
+ self.output.push('\n');
+ }
+ Tag::TableCell => {
+ if table_cell_index != 0 {
+ // Separator between columns.
+ self.output.push(':');
+ }
+ // Start a text block.
+ self.output.push_str("T{\n");
+ table_cell_index += 1
+ }
+ Tag::Emphasis => self.push_font(Font::Italic),
+ Tag::Strong => self.push_font(Font::Bold),
+ // Strikethrough isn't usually supported for TTY.
+ Tag::Strikethrough => self.output.push_str("~~"),
+ Tag::Link(link_type, dest_url, _title) => {
+ if dest_url.starts_with('#') {
+ // In a man page, page-relative anchors don't
+ // have much meaning.
+ continue;
+ }
+ match link_type {
+ LinkType::Autolink | LinkType::Email => {
+ // The text is a copy of the URL, which is not needed.
+ match self.parser.next() {
+ Some((Event::Text(_), _range)) => {}
+ _ => bail!("expected text after autolink"),
+ }
+ }
+ LinkType::Inline
+ | LinkType::Reference
+ | LinkType::Collapsed
+ | LinkType::Shortcut => {
+ self.push_font(Font::Italic);
+ }
+ // This is currently unused. This is only
+ // emitted with a broken link callback, but I
+ // felt it is too annoying to escape `[` in
+ // option descriptions.
+ LinkType::ReferenceUnknown
+ | LinkType::CollapsedUnknown
+ | LinkType::ShortcutUnknown => {
+ bail!(
+ "link with missing reference `{}` located at offset {}",
+ dest_url,
+ range.start
+ );
+ }
+ }
+ }
+ Tag::Image(_link_type, _dest_url, _title) => {
+ bail!("images are not currently supported")
+ }
+ }
+ }
+ Event::End(tag) => {
+ match &tag {
+ Tag::Paragraph => self.flush(),
+ Tag::Heading(_n) => {}
+ Tag::BlockQuote => {
+ self.flush();
+ // restore left margin, restore line length
+ self.output.push_str(".br\n.RE\n.ll\n");
+ }
+ Tag::CodeBlock(_kind) => {
+ self.flush();
+ // Restore fill mode, move margin back one level.
+ self.output.push_str(".fi\n.RE\n");
+ }
+ Tag::List(_) => {
+ list.pop();
+ }
+ Tag::Item => {
+ self.flush();
+ // Move margin back one level.
+ self.output.push_str(".RE\n");
+ }
+ Tag::FootnoteDefinition(_label) => {}
+ Tag::Table(_) => {
+ // Table end
+ // I don't know why, but the .sp is needed to provide
+ // space with the following content.
+ self.output.push_str("\n.TE\n.sp\n");
+ }
+ Tag::TableHead => {}
+ Tag::TableRow => {}
+ Tag::TableCell => {
+ // End text block.
+ self.output.push_str("\nT}");
+ }
+ Tag::Emphasis | Tag::Strong => self.pop_font(),
+ Tag::Strikethrough => self.output.push_str("~~"),
+ Tag::Link(link_type, dest_url, _title) => {
+ if dest_url.starts_with('#') {
+ continue;
+ }
+ match link_type {
+ LinkType::Autolink | LinkType::Email => {}
+ LinkType::Inline
+ | LinkType::Reference
+ | LinkType::Collapsed
+ | LinkType::Shortcut => {
+ self.pop_font();
+ self.output.push(' ');
+ }
+ _ => {
+ panic!("unexpected tag {:?}", tag);
+ }
+ }
+ write!(self.output, "<{}>", escape(&dest_url)?)?;
+ }
+ Tag::Image(_link_type, _dest_url, _title) => {}
+ }
+ }
+ Event::Text(t) => {
+ self.output.push_str(&escape(&t)?);
+ }
+ Event::Code(t) => {
+ self.push_font(Font::Bold);
+ self.output.push_str(&escape(&t)?);
+ self.pop_font();
+ }
+ Event::Html(t) => {
+ if t.starts_with("") {
+ in_cdata = false;
+ } else if !t.trim().is_empty() {
+ self.output.push_str(&t);
+ }
+ } else {
+ self.output.push_str(&escape(&t)?);
+ }
+ }
+ Event::FootnoteReference(_t) => {}
+ Event::SoftBreak => self.output.push('\n'),
+ Event::HardBreak => {
+ self.flush();
+ self.output.push_str(".br\n");
+ }
+ Event::Rule => {
+ self.flush();
+ // \l' **length** ' Draw horizontal line (default underscore).
+ // \n(.lu Gets value from register "lu" (current line length)
+ self.output.push_str("\\l'\\n(.lu'\n");
+ }
+ Event::TaskListMarker(_b) => unimplemented!(),
+ }
+ }
+ Ok(())
+ }
+
+ fn flush(&mut self) {
+ if !self.output.ends_with('\n') {
+ self.output.push('\n');
+ }
+ }
+
+ /// Switch to the given font.
+ ///
+ /// Because the troff sequence `\fP` for switching to the "previous" font
+ /// doesn't support nesting, this needs to emulate it here. This is needed
+ /// for situations like **hi _there_**.
+ fn push_font(&mut self, font: Font) {
+ self.font_stack.push(font);
+ self.output.push_str(Font::str_from_stack(&self.font_stack));
+ }
+
+ fn pop_font(&mut self) {
+ self.font_stack.pop();
+ self.output.push_str(Font::str_from_stack(&self.font_stack));
+ }
+
+ /// Parse and render the first top-level header of the document.
+ fn push_top_header(&mut self) -> Result<(), Error> {
+ // This enables the tbl preprocessor for tables.
+ // This seems to be enabled by default on every modern system I could
+ // find, but it doesn't seem to hurt to enable this.
+ self.output.push_str("'\\\" t\n");
+ // Extract the name of the man page.
+ let text = header_text(&mut self.parser)?;
+ let (name, section) = parse_name_and_section(&text)?;
+ // .TH = Table header
+ // .nh = disable hyphenation
+ // .ad l = Left-adjust mode (disable justified).
+ // .ss sets sentence_space_size to 0 (prevents double spaces after .
+ // if . is last on the line)
+ write!(
+ self.output,
+ ".TH \"{}\" \"{}\"\n\
+ .nh\n\
+ .ad l\n\
+ .ss \\n[.ss] 0\n",
+ escape(&name.to_uppercase())?,
+ section
+ )?;
+ Ok(())
+ }
+}
+
+fn escape(s: &str) -> Result {
+ let mut replaced = s
+ .replace('\\', "\\(rs")
+ .replace('-', "\\-")
+ .replace('\u{00A0}', "\\ ") // non-breaking space (non-stretchable)
+ .replace('–', "\\[en]") // \u{2013} en-dash
+ .replace('—', "\\[em]") // \u{2014} em-dash
+ .replace('│', "|") // \u{2502} box drawing light vertical (could use \[br])
+ .replace('├', "|") // \u{251C} box drawings light vertical and right
+ .replace('└', "`") // \u{2514} box drawings light up and right
+ .replace('─', "\\-") // \u{2500} box drawing light horizontal
+ ;
+ if replaced.starts_with('.') {
+ replaced = format!("\\&.{}", &replaced[1..]);
+ } else if replaced.starts_with('\'') {
+ replaced = format!("\\(aq{}", &replaced[1..]);
+ }
+
+ if let Some(ch) = replaced.chars().find(|ch| {
+ !matches!(ch, '\n' | ' ' | '!'..='/' | '0'..='9'
+ | ':'..='@' | 'A'..='Z' | '['..='`' | 'a'..='z' | '{'..='~')
+ }) {
+ bail!(
+ "character {:?} is not allowed (update the translation table if needed)",
+ ch
+ );
+ }
+ Ok(replaced)
+}
diff --git a/crates/mdman/src/format/md.rs b/crates/mdman/src/format/md.rs
new file mode 100644
index 00000000000..4cf4728f22c
--- /dev/null
+++ b/crates/mdman/src/format/md.rs
@@ -0,0 +1,114 @@
+//! Markdown formatter.
+
+use crate::util::unwrap;
+use crate::ManMap;
+use anyhow::{bail, format_err, Error};
+use std::fmt::Write;
+use url::Url;
+
+pub struct MdFormatter {
+ url: Option,
+ man_map: ManMap,
+}
+
+impl MdFormatter {
+ pub fn new(url: Option, man_map: ManMap) -> MdFormatter {
+ MdFormatter { url, man_map }
+ }
+}
+
+impl MdFormatter {
+ fn render_html(&self, input: &str) -> Result {
+ let parser = crate::md_parser(input, self.url.clone());
+ let mut html_output: String = String::with_capacity(input.len() * 3 / 2);
+ pulldown_cmark::html::push_html(&mut html_output, parser.map(|(e, _r)| e));
+ Ok(html_output)
+ }
+}
+
+impl super::Formatter for MdFormatter {
+ fn render(&self, input: &str) -> Result {
+ Ok(input.replace("\r\n", "\n"))
+ }
+
+ fn render_options_start(&self) -> &'static str {
+ ""
+ }
+
+ fn render_options_end(&self) -> &'static str {
+ " "
+ }
+
+ fn render_option(&self, params: &[&str], block: &str, man_name: &str) -> Result {
+ let mut result = String::new();
+ fn unwrap_p(t: &str) -> &str {
+ unwrap(t, "", "
")
+ }
+
+ for param in params {
+ let rendered = self.render_html(param)?;
+ let no_p = unwrap_p(&rendered);
+ // split out first term to use as the id.
+ let first = no_p
+ .split_whitespace()
+ .next()
+ .ok_or_else(|| format_err!("did not expect option `{}` to be empty", param))?;
+ let no_tags = trim_tags(first);
+ if no_tags.is_empty() {
+ bail!("unexpected empty option with no tags `{}`", param);
+ }
+ let id = format!("option-{}-{}", man_name, no_tags);
+ write!(
+ result,
+ "\
+ {OPTION} \n",
+ ID = id,
+ OPTION = no_p
+ )?;
+ }
+ let rendered_block = self.render_html(block)?;
+ write!(
+ result,
+ "{} \n",
+ unwrap_p(&rendered_block)
+ )?;
+ Ok(result)
+ }
+
+ fn linkify_man_to_md(&self, name: &str, section: u8) -> Result {
+ let s = match self.man_map.get(&(name.to_string(), section)) {
+ Some(link) => format!("[{}({})]({})", name, section, link),
+ None => format!("[{}({})]({}.md)", name, section, name),
+ };
+ Ok(s)
+ }
+}
+
+fn trim_tags(s: &str) -> String {
+ // This is a hack. It removes all HTML tags.
+ let mut in_tag = false;
+ let mut in_char_ref = false;
+ s.chars()
+ .filter(|&ch| match ch {
+ '<' if in_tag => panic!("unexpected nested tag"),
+ '&' if in_char_ref => panic!("unexpected nested char ref"),
+ '<' => {
+ in_tag = true;
+ false
+ }
+ '&' => {
+ in_char_ref = true;
+ false
+ }
+ '>' if in_tag => {
+ in_tag = false;
+ false
+ }
+ ';' if in_char_ref => {
+ in_char_ref = false;
+ false
+ }
+ _ => !in_tag && !in_char_ref,
+ })
+ .collect()
+}
diff --git a/crates/mdman/src/format/text.rs b/crates/mdman/src/format/text.rs
new file mode 100644
index 00000000000..2c6a4ff1747
--- /dev/null
+++ b/crates/mdman/src/format/text.rs
@@ -0,0 +1,605 @@
+//! Text formatter.
+
+use crate::util::{header_text, unwrap};
+use crate::EventIter;
+use anyhow::{bail, Error};
+use pulldown_cmark::{Alignment, Event, LinkType, Tag};
+use std::fmt::Write;
+use std::mem;
+use url::Url;
+
+pub struct TextFormatter {
+ url: Option,
+}
+
+impl TextFormatter {
+ pub fn new(url: Option) -> TextFormatter {
+ TextFormatter { url }
+ }
+}
+
+impl super::Formatter for TextFormatter {
+ fn render(&self, input: &str) -> Result {
+ TextRenderer::render(input, self.url.clone(), 0)
+ }
+
+ fn render_options_start(&self) -> &'static str {
+ // Tell pulldown_cmark to ignore this.
+ // This will be stripped out later.
+ " &'static str {
+ "]]>"
+ }
+
+ fn render_option(
+ &self,
+ params: &[&str],
+ block: &str,
+ _man_name: &str,
+ ) -> Result {
+ let rendered_options = params
+ .iter()
+ .map(|param| TextRenderer::render(param, self.url.clone(), 0))
+ .collect::, Error>>()?;
+ let trimmed: Vec<_> = rendered_options.iter().map(|o| o.trim()).collect();
+ // Wrap in HTML tags, they will be stripped out during rendering.
+ Ok(format!(
+ "{} \n{} \n \n",
+ trimmed.join(", "),
+ block
+ ))
+ }
+
+ fn linkify_man_to_md(&self, name: &str, section: u8) -> Result {
+ Ok(format!("`{}`({})", name, section))
+ }
+}
+
+struct TextRenderer<'e> {
+ output: String,
+ indent: usize,
+ /// The current line being written. Once a line break is encountered (such
+ /// as starting a new paragraph), this will be written to `output` via
+ /// `flush`.
+ line: String,
+ /// The current word being written. Once a break is encountered (such as a
+ /// space) this will be written to `line` via `flush_word`.
+ word: String,
+ parser: EventIter<'e>,
+ /// The base URL used for relative URLs.
+ url: Option,
+ table: Table,
+}
+
+impl<'e> TextRenderer<'e> {
+ fn render(input: &str, url: Option, indent: usize) -> Result {
+ let parser = crate::md_parser(input, url.clone());
+ let output = String::with_capacity(input.len() * 3 / 2);
+ let mut mr = TextRenderer {
+ output,
+ indent,
+ line: String::new(),
+ word: String::new(),
+ parser,
+ url,
+ table: Table::new(),
+ };
+ mr.push_md()?;
+ Ok(mr.output)
+ }
+
+ fn push_md(&mut self) -> Result<(), Error> {
+ // If this is true, this is inside a cdata block used for hiding
+ // content from pulldown_cmark.
+ let mut in_cdata = false;
+ // The current list stack. None if unordered, Some if ordered with the
+ // given number as the current index.
+ let mut list: Vec> = Vec::new();
+ // Used in some cases where spacing isn't desired.
+ let mut suppress_paragraph = false;
+ // Whether or not word-wrapping is enabled.
+ let mut wrap_text = true;
+
+ while let Some((event, range)) = self.parser.next() {
+ let this_suppress_paragraph = suppress_paragraph;
+ // Always reset suppression, even if the next event isn't a
+ // paragraph. This is in essence, a 1-token lookahead where the
+ // suppression is only enabled if the next event is a paragraph.
+ suppress_paragraph = false;
+ match event {
+ Event::Start(tag) => {
+ match tag {
+ Tag::Paragraph => {
+ if !this_suppress_paragraph {
+ self.flush();
+ }
+ }
+ Tag::Heading(n) => {
+ self.flush();
+ if n == 1 {
+ let text = header_text(&mut self.parser)?;
+ self.push_to_line(&text.to_uppercase());
+ self.hard_break();
+ self.hard_break();
+ } else if n == 2 {
+ let text = header_text(&mut self.parser)?;
+ self.push_to_line(&text.to_uppercase());
+ self.flush();
+ self.indent = 7;
+ } else {
+ let text = header_text(&mut self.parser)?;
+ self.push_indent((n as usize - 2) * 3);
+ self.push_to_line(&text);
+ self.flush();
+ self.indent = (n as usize - 1) * 3 + 1;
+ }
+ }
+ Tag::BlockQuote => {
+ self.indent += 3;
+ }
+ Tag::CodeBlock(_kind) => {
+ self.flush();
+ wrap_text = false;
+ self.indent += 4;
+ }
+ Tag::List(start) => list.push(start),
+ Tag::Item => {
+ self.flush();
+ match list.last_mut().expect("item must have list start") {
+ // Ordered list.
+ Some(n) => {
+ self.push_indent(self.indent);
+ write!(self.line, "{}.", n)?;
+ *n += 1;
+ }
+ // Unordered list.
+ None => {
+ self.push_indent(self.indent);
+ self.push_to_line("o ")
+ }
+ }
+ self.indent += 3;
+ suppress_paragraph = true;
+ }
+ Tag::FootnoteDefinition(_label) => unimplemented!(),
+ Tag::Table(alignment) => {
+ assert!(self.table.alignment.is_empty());
+ self.flush();
+ self.table.alignment.extend(alignment);
+ let table = self.table.process(&mut self.parser, self.indent)?;
+ self.output.push_str(&table);
+ self.hard_break();
+ self.table = Table::new();
+ }
+ Tag::TableHead | Tag::TableRow | Tag::TableCell => {
+ bail!("unexpected table element")
+ }
+ Tag::Emphasis => {}
+ Tag::Strong => {}
+ // Strikethrough isn't usually supported for TTY.
+ Tag::Strikethrough => self.word.push_str("~~"),
+ Tag::Link(link_type, dest_url, _title) => {
+ if dest_url.starts_with('#') {
+ // In a man page, page-relative anchors don't
+ // have much meaning.
+ continue;
+ }
+ match link_type {
+ LinkType::Autolink | LinkType::Email => {
+ // The text is a copy of the URL, which is not needed.
+ match self.parser.next() {
+ Some((Event::Text(_), _range)) => {}
+ _ => bail!("expected text after autolink"),
+ }
+ }
+ LinkType::Inline
+ | LinkType::Reference
+ | LinkType::Collapsed
+ | LinkType::Shortcut => {}
+ // This is currently unused. This is only
+ // emitted with a broken link callback, but I
+ // felt it is too annoying to escape `[` in
+ // option descriptions.
+ LinkType::ReferenceUnknown
+ | LinkType::CollapsedUnknown
+ | LinkType::ShortcutUnknown => {
+ bail!(
+ "link with missing reference `{}` located at offset {}",
+ dest_url,
+ range.start
+ );
+ }
+ }
+ }
+ Tag::Image(_link_type, _dest_url, _title) => {
+ bail!("images are not currently supported")
+ }
+ }
+ }
+ Event::End(tag) => match &tag {
+ Tag::Paragraph => {
+ self.flush();
+ self.hard_break();
+ }
+ Tag::Heading(_n) => {}
+ Tag::BlockQuote => {
+ self.indent -= 3;
+ }
+ Tag::CodeBlock(_kind) => {
+ self.hard_break();
+ wrap_text = true;
+ self.indent -= 4;
+ }
+ Tag::List(_) => {
+ list.pop();
+ }
+ Tag::Item => {
+ self.flush();
+ self.indent -= 3;
+ self.hard_break();
+ }
+ Tag::FootnoteDefinition(_label) => {}
+ Tag::Table(_) => {}
+ Tag::TableHead => {}
+ Tag::TableRow => {}
+ Tag::TableCell => {}
+ Tag::Emphasis => {}
+ Tag::Strong => {}
+ Tag::Strikethrough => self.word.push_str("~~"),
+ Tag::Link(link_type, dest_url, _title) => {
+ if dest_url.starts_with('#') {
+ continue;
+ }
+ match link_type {
+ LinkType::Autolink | LinkType::Email => {}
+ LinkType::Inline
+ | LinkType::Reference
+ | LinkType::Collapsed
+ | LinkType::Shortcut => self.flush_word(),
+ _ => {
+ panic!("unexpected tag {:?}", tag);
+ }
+ }
+ self.flush_word();
+ write!(self.word, "<{}>", dest_url)?;
+ }
+ Tag::Image(_link_type, _dest_url, _title) => {}
+ },
+ Event::Text(t) | Event::Code(t) => {
+ if wrap_text {
+ let chunks = split_chunks(&t);
+ for chunk in chunks {
+ if chunk == " " {
+ self.flush_word();
+ } else {
+ self.word.push_str(chunk);
+ }
+ }
+ } else {
+ for line in t.lines() {
+ self.push_indent(self.indent);
+ self.push_to_line(line);
+ self.flush();
+ }
+ }
+ }
+ Event::Html(t) => {
+ if t.starts_with("") {
+ in_cdata = false;
+ } else {
+ let trimmed = t.trim();
+ if trimmed.is_empty() {
+ continue;
+ }
+ if trimmed == " " {
+ self.hard_break();
+ } else if trimmed.starts_with("") {
+ let opts = unwrap(trimmed, "", " ");
+ self.push_indent(self.indent);
+ self.push_to_line(opts);
+ self.flush();
+ } else if trimmed.starts_with(" ") {
+ let mut def = String::new();
+ while let Some((Event::Html(t), _range)) = self.parser.next() {
+ if t.starts_with(" ") {
+ break;
+ }
+ def.push_str(&t);
+ }
+ let rendered =
+ TextRenderer::render(&def, self.url.clone(), self.indent + 4)?;
+ self.push_to_line(rendered.trim_end());
+ self.flush();
+ } else {
+ self.push_to_line(&t);
+ self.flush();
+ }
+ }
+ } else {
+ self.push_to_line(&t);
+ self.flush();
+ }
+ }
+ Event::FootnoteReference(_t) => {}
+ Event::SoftBreak => self.flush_word(),
+ Event::HardBreak => self.flush(),
+ Event::Rule => {
+ self.flush();
+ self.push_indent(self.indent);
+ self.push_to_line(&"_".repeat(79 - self.indent * 2));
+ self.flush();
+ }
+ Event::TaskListMarker(_b) => unimplemented!(),
+ }
+ }
+ Ok(())
+ }
+
+ fn flush(&mut self) {
+ self.flush_word();
+ if !self.line.is_empty() {
+ self.output.push_str(&self.line);
+ self.output.push('\n');
+ self.line.clear();
+ }
+ }
+
+ fn hard_break(&mut self) {
+ self.flush();
+ if !self.output.ends_with("\n\n") {
+ self.output.push('\n');
+ }
+ }
+
+ fn flush_word(&mut self) {
+ if self.word.is_empty() {
+ return;
+ }
+ if self.line.len() + self.word.len() >= 79 {
+ self.output.push_str(&self.line);
+ self.output.push('\n');
+ self.line.clear();
+ }
+ if self.line.is_empty() {
+ self.push_indent(self.indent);
+ self.line.push_str(&self.word);
+ } else {
+ self.line.push(' ');
+ self.line.push_str(&self.word);
+ }
+ self.word.clear();
+ }
+
+ fn push_indent(&mut self, indent: usize) {
+ for _ in 0..indent {
+ self.line.push(' ');
+ }
+ }
+
+ fn push_to_line(&mut self, text: &str) {
+ self.flush_word();
+ self.line.push_str(text);
+ }
+}
+
+/// Splits the text on whitespace.
+///
+/// Consecutive whitespace is collapsed to a single ' ', and is included as a
+/// separate element in the result.
+fn split_chunks(text: &str) -> Vec<&str> {
+ let mut result = Vec::new();
+ let mut start = 0;
+ while start < text.len() {
+ match text[start..].find(' ') {
+ Some(i) => {
+ if i != 0 {
+ result.push(&text[start..start + i]);
+ }
+ result.push(" ");
+ // Skip past whitespace.
+ match text[start + i..].find(|c| c != ' ') {
+ Some(n) => {
+ start = start + i + n;
+ }
+ None => {
+ break;
+ }
+ }
+ }
+ None => {
+ result.push(&text[start..]);
+ break;
+ }
+ }
+ }
+ result
+}
+
+struct Table {
+ alignment: Vec,
+ rows: Vec>,
+ row: Vec,
+ cell: String,
+}
+
+impl Table {
+ fn new() -> Table {
+ Table {
+ alignment: Vec::new(),
+ rows: Vec::new(),
+ row: Vec::new(),
+ cell: String::new(),
+ }
+ }
+
+ /// Processes table events and generates a text table.
+ fn process(&mut self, parser: &mut EventIter<'_>, indent: usize) -> Result {
+ while let Some((event, _range)) = parser.next() {
+ match event {
+ Event::Start(tag) => match tag {
+ Tag::TableHead
+ | Tag::TableRow
+ | Tag::TableCell
+ | Tag::Emphasis
+ | Tag::Strong => {}
+ Tag::Strikethrough => self.cell.push_str("~~"),
+ // Links not yet supported, they usually won't fit.
+ Tag::Link(_, _, _) => {}
+ _ => bail!("unexpected tag in table: {:?}", tag),
+ },
+ Event::End(tag) => match tag {
+ Tag::Table(_) => return self.render(indent),
+ Tag::TableCell => {
+ let cell = mem::replace(&mut self.cell, String::new());
+ self.row.push(cell);
+ }
+ Tag::TableHead | Tag::TableRow => {
+ let row = mem::replace(&mut self.row, Vec::new());
+ self.rows.push(row);
+ }
+ Tag::Strikethrough => self.cell.push_str("~~"),
+ _ => {}
+ },
+ Event::Text(t) | Event::Code(t) => {
+ self.cell.push_str(&t);
+ }
+ Event::Html(t) => bail!("html unsupported in tables: {:?}", t),
+ _ => bail!("unexpected event in table: {:?}", event),
+ }
+ }
+ bail!("table end not reached");
+ }
+
+ fn render(&self, indent: usize) -> Result {
+ // This is an extremely primitive layout routine.
+ // First compute the potential maximum width of each cell.
+ // 2 for 1 space margin on left and right.
+ let width_acc = vec![2; self.alignment.len()];
+ let mut col_widths = self
+ .rows
+ .iter()
+ .map(|row| row.iter().map(|cell| cell.len()))
+ .fold(width_acc, |mut acc, row| {
+ acc.iter_mut()
+ .zip(row)
+ // +3 for left/right margin and | symbol
+ .for_each(|(a, b)| *a = (*a).max(b + 3));
+ acc
+ });
+ // Shrink each column until it fits the total width, proportional to
+ // the columns total percent width.
+ let max_width = 78 - indent;
+ // Include total len for | characters, and +1 for final |.
+ let total_width = col_widths.iter().sum::() + col_widths.len() + 1;
+ if total_width > max_width {
+ let to_shrink = total_width - max_width;
+ // Compute percentage widths, and shrink each column based on its
+ // total percentage.
+ for width in &mut col_widths {
+ let percent = *width as f64 / total_width as f64;
+ *width -= (to_shrink as f64 * percent).ceil() as usize;
+ }
+ }
+ // Start rendering.
+ let mut result = String::new();
+
+ // Draw the horizontal line separating each row.
+ let mut row_line = String::new();
+ row_line.push_str(&" ".repeat(indent));
+ row_line.push('+');
+ let lines = col_widths
+ .iter()
+ .map(|width| "-".repeat(*width))
+ .collect::>();
+ row_line.push_str(&lines.join("+"));
+ row_line.push('+');
+ row_line.push('\n');
+
+ // Draw top of the table.
+ result.push_str(&row_line);
+ // Draw each row.
+ for row in &self.rows {
+ // Word-wrap and fill each column as needed.
+ let filled = fill_row(row, &col_widths, &self.alignment);
+ // Need to transpose the cells across rows for cells that span
+ // multiple rows.
+ let height = filled.iter().map(|c| c.len()).max().unwrap();
+ for row_i in 0..height {
+ result.push_str(&" ".repeat(indent));
+ result.push('|');
+ for filled_row in &filled {
+ let cell = &filled_row[row_i];
+ result.push_str(cell);
+ result.push('|');
+ }
+ result.push('\n');
+ }
+ result.push_str(&row_line);
+ }
+ Ok(result)
+ }
+}
+
+/// Formats a row, filling cells with spaces and word-wrapping text.
+///
+/// Returns a vec of cells, where each cell is split into multiple lines.
+fn fill_row(row: &[String], col_widths: &[usize], alignment: &[Alignment]) -> Vec> {
+ let mut cell_lines = row
+ .iter()
+ .zip(col_widths)
+ .zip(alignment)
+ .map(|((cell, width), alignment)| fill_cell(cell, *width - 2, *alignment))
+ .collect::>();
+ // Fill each cell to match the maximum vertical height of the tallest cell.
+ let max_lines = cell_lines.iter().map(|cell| cell.len()).max().unwrap();
+ for (cell, width) in cell_lines.iter_mut().zip(col_widths) {
+ if cell.len() < max_lines {
+ cell.extend(std::iter::repeat(" ".repeat(*width)).take(max_lines - cell.len()));
+ }
+ }
+ cell_lines
+}
+
+/// Formats a cell. Word-wraps based on width, and adjusts based on alignment.
+///
+/// Returns a vec of lines for the cell.
+fn fill_cell(text: &str, width: usize, alignment: Alignment) -> Vec {
+ let fill_width = |text: &str| match alignment {
+ Alignment::None | Alignment::Left => format!(" {: format!(" {:^width$} ", text, width = width),
+ Alignment::Right => format!(" {:>width$} ", text, width = width),
+ };
+ if text.len() < width {
+ // No wrapping necessary, just format.
+ vec![fill_width(text)]
+ } else {
+ // Word-wrap the cell.
+ let mut result = Vec::new();
+ let mut line = String::new();
+ for word in text.split_whitespace() {
+ if line.len() + word.len() >= width {
+ // todo: word.len() > width
+ result.push(fill_width(&line));
+ line.clear();
+ }
+ if line.is_empty() {
+ line.push_str(word);
+ } else {
+ line.push(' ');
+ line.push_str(&word);
+ }
+ }
+ if !line.is_empty() {
+ result.push(fill_width(&line));
+ }
+
+ result
+ }
+}
diff --git a/crates/mdman/src/hbs.rs b/crates/mdman/src/hbs.rs
new file mode 100644
index 00000000000..a8cbae94ad8
--- /dev/null
+++ b/crates/mdman/src/hbs.rs
@@ -0,0 +1,217 @@
+//! Handlebars template processing.
+
+use crate::format::Formatter;
+use anyhow::Error;
+use handlebars::{
+ handlebars_helper, Context, Decorator, Handlebars, Helper, HelperDef, HelperResult, Output,
+ RenderContext, RenderError, Renderable,
+};
+use std::collections::HashMap;
+use std::convert::TryFrom;
+use std::path::Path;
+
+type FormatterRef<'a> = &'a (dyn Formatter + Send + Sync);
+
+/// Processes the handlebars template at the given file.
+pub fn expand(file: &Path, formatter: FormatterRef) -> Result {
+ let mut handlebars = Handlebars::new();
+ handlebars.set_strict_mode(true);
+ handlebars.register_helper("lower", Box::new(lower));
+ handlebars.register_helper("options", Box::new(OptionsHelper { formatter }));
+ handlebars.register_helper("option", Box::new(OptionHelper { formatter }));
+ handlebars.register_helper("man", Box::new(ManLinkHelper { formatter }));
+ handlebars.register_decorator("set", Box::new(set_decorator));
+ handlebars.register_template_file("template", file)?;
+ let includes = file.parent().unwrap().join("includes");
+ handlebars.register_templates_directory(".md", includes)?;
+ let mut data: HashMap = HashMap::new();
+ let man_name = file
+ .file_stem()
+ .expect("expected filename")
+ .to_str()
+ .expect("utf8 filename")
+ .to_string();
+ data.insert("man_name".to_string(), man_name);
+ let expanded = handlebars.render("template", &data)?;
+ Ok(expanded)
+}
+
+/// Helper for `{{#options}}` block.
+struct OptionsHelper<'a> {
+ formatter: FormatterRef<'a>,
+}
+
+impl HelperDef for OptionsHelper<'_> {
+ fn call<'reg: 'rc, 'rc>(
+ &self,
+ h: &Helper<'reg, 'rc>,
+ r: &'reg Handlebars<'reg>,
+ ctx: &'rc Context,
+ rc: &mut RenderContext<'reg, 'rc>,
+ out: &mut dyn Output,
+ ) -> HelperResult {
+ if in_options(rc) {
+ return Err(RenderError::new("options blocks cannot be nested"));
+ }
+ // Prevent nested {{#options}}.
+ set_in_context(rc, "__MDMAN_IN_OPTIONS", serde_json::Value::Bool(true));
+ let s = self.formatter.render_options_start();
+ out.write(&s)?;
+ let t = match h.template() {
+ Some(t) => t,
+ None => return Err(RenderError::new("options block must not be empty")),
+ };
+ let block = t.renders(r, ctx, rc)?;
+ out.write(&block)?;
+
+ let s = self.formatter.render_options_end();
+ out.write(&s)?;
+ remove_from_context(rc, "__MDMAN_IN_OPTIONS");
+ Ok(())
+ }
+}
+
+/// Whether or not the context is currently inside a `{{#options}}` block.
+fn in_options(rc: &RenderContext<'_, '_>) -> bool {
+ rc.context()
+ .map_or(false, |ctx| ctx.data().get("__MDMAN_IN_OPTIONS").is_some())
+}
+
+/// Helper for `{{#option}}` block.
+struct OptionHelper<'a> {
+ formatter: FormatterRef<'a>,
+}
+
+impl HelperDef for OptionHelper<'_> {
+ fn call<'reg: 'rc, 'rc>(
+ &self,
+ h: &Helper<'reg, 'rc>,
+ r: &'reg Handlebars<'reg>,
+ ctx: &'rc Context,
+ rc: &mut RenderContext<'reg, 'rc>,
+ out: &mut dyn Output,
+ ) -> HelperResult {
+ if !in_options(rc) {
+ return Err(RenderError::new("option must be in options block"));
+ }
+ let params = h.params();
+ if params.is_empty() {
+ return Err(RenderError::new(
+ "option block must have at least one param",
+ ));
+ }
+ // Convert params to strings.
+ let params = params
+ .iter()
+ .map(|param| {
+ param
+ .value()
+ .as_str()
+ .ok_or_else(|| RenderError::new("option params must be strings"))
+ })
+ .collect::, RenderError>>()?;
+ let t = match h.template() {
+ Some(t) => t,
+ None => return Err(RenderError::new("option block must not be empty")),
+ };
+ // Render the block.
+ let block = t.renders(r, ctx, rc)?;
+
+ // Get the name of this page.
+ let man_name = ctx
+ .data()
+ .get("man_name")
+ .expect("expected man_name in context")
+ .as_str()
+ .expect("expect man_name str");
+
+ // Ask the formatter to convert this option to its format.
+ let option = self
+ .formatter
+ .render_option(¶ms, &block, man_name)
+ .map_err(|e| RenderError::new(format!("option render failed: {}", e)))?;
+ out.write(&option)?;
+ Ok(())
+ }
+}
+
+/// Helper for `{{man name section}}` expression.
+struct ManLinkHelper<'a> {
+ formatter: FormatterRef<'a>,
+}
+
+impl HelperDef for ManLinkHelper<'_> {
+ fn call<'reg: 'rc, 'rc>(
+ &self,
+ h: &Helper<'reg, 'rc>,
+ _r: &'reg Handlebars<'reg>,
+ _ctx: &'rc Context,
+ _rc: &mut RenderContext<'reg, 'rc>,
+ out: &mut dyn Output,
+ ) -> HelperResult {
+ let params = h.params();
+ if params.len() != 2 {
+ return Err(RenderError::new("{{man}} must have two arguments"));
+ }
+ let name = params[0]
+ .value()
+ .as_str()
+ .ok_or_else(|| RenderError::new("man link name must be a string"))?;
+ let section = params[1]
+ .value()
+ .as_u64()
+ .ok_or_else(|| RenderError::new("man link section must be an integer"))?;
+ let section =
+ u8::try_from(section).map_err(|_e| RenderError::new("section number too large"))?;
+ let link = self
+ .formatter
+ .linkify_man_to_md(name, section)
+ .map_err(|e| RenderError::new(format!("failed to linkify man: {}", e)))?;
+ out.write(&link)?;
+ Ok(())
+ }
+}
+
+/// `{{*set var=value}}` decorator.
+///
+/// This sets a variable to a value within the template context.
+fn set_decorator(
+ d: &Decorator,
+ _: &Handlebars,
+ _ctx: &Context,
+ rc: &mut RenderContext,
+) -> Result<(), RenderError> {
+ let data_to_set = d.hash();
+ for (k, v) in data_to_set {
+ set_in_context(rc, k, v.value().clone());
+ }
+ Ok(())
+}
+
+/// Sets a variable to a value within the context.
+fn set_in_context(rc: &mut RenderContext, key: &str, value: serde_json::Value) {
+ let mut ctx = match rc.context() {
+ Some(c) => (*c).clone(),
+ None => Context::wraps(serde_json::Value::Object(serde_json::Map::new())).unwrap(),
+ };
+ if let serde_json::Value::Object(m) = ctx.data_mut() {
+ m.insert(key.to_string(), value);
+ rc.set_context(ctx);
+ } else {
+ panic!("expected object in context");
+ }
+}
+
+/// Removes a variable from the context.
+fn remove_from_context(rc: &mut RenderContext, key: &str) {
+ let ctx = rc.context().expect("cannot remove from null context");
+ let mut ctx = (*ctx).clone();
+ if let serde_json::Value::Object(m) = ctx.data_mut() {
+ m.remove(key);
+ rc.set_context(ctx);
+ } else {
+ panic!("expected object in context");
+ }
+}
+
+handlebars_helper!(lower: |s: str| s.to_lowercase());
diff --git a/crates/mdman/src/lib.rs b/crates/mdman/src/lib.rs
new file mode 100644
index 00000000000..a362ae22127
--- /dev/null
+++ b/crates/mdman/src/lib.rs
@@ -0,0 +1,121 @@
+//! mdman markdown to man converter.
+
+use anyhow::{bail, Context, Error};
+use pulldown_cmark::{CowStr, Event, LinkType, Options, Parser, Tag};
+use std::collections::HashMap;
+use std::fs;
+use std::io::{self, BufRead};
+use std::ops::Range;
+use std::path::Path;
+use url::Url;
+
+mod format;
+mod hbs;
+mod util;
+
+use format::Formatter;
+
+/// Mapping of `(name, section)` of a man page to a URL.
+pub type ManMap = HashMap<(String, u8), String>;
+
+/// A man section.
+pub type Section = u8;
+
+/// The output formats supported by mdman.
+#[derive(Copy, Clone)]
+pub enum Format {
+ Man,
+ Md,
+ Text,
+}
+
+impl Format {
+ /// The filename extension for the format.
+ pub fn extension(&self, section: Section) -> String {
+ match self {
+ Format::Man => section.to_string(),
+ Format::Md => "md".to_string(),
+ Format::Text => "txt".to_string(),
+ }
+ }
+}
+
+/// Converts the handlebars markdown file at the given path into the given
+/// format, returning the translated result.
+pub fn convert(
+ file: &Path,
+ format: Format,
+ url: Option,
+ man_map: ManMap,
+) -> Result {
+ let formatter: Box = match format {
+ Format::Man => Box::new(format::man::ManFormatter::new(url)),
+ Format::Md => Box::new(format::md::MdFormatter::new(url, man_map)),
+ Format::Text => Box::new(format::text::TextFormatter::new(url)),
+ };
+ let expanded = hbs::expand(file, &*formatter)?;
+ // pulldown-cmark can behave a little differently with Windows newlines,
+ // just normalize it.
+ let expanded = expanded.replace("\r\n", "\n");
+ formatter.render(&expanded)
+}
+
+/// Pulldown-cmark iterator yielding an `(event, range)` tuple.
+type EventIter<'a> = Box, Range)> + 'a>;
+
+/// Creates a new markdown parser with the given input.
+pub(crate) fn md_parser(input: &str, url: Option) -> EventIter {
+ let mut options = Options::empty();
+ options.insert(Options::ENABLE_TABLES);
+ options.insert(Options::ENABLE_FOOTNOTES);
+ options.insert(Options::ENABLE_STRIKETHROUGH);
+ let parser = Parser::new_ext(input, options);
+ let parser = parser.into_offset_iter();
+ // Translate all links to include the base url.
+ let parser = parser.map(move |(event, range)| match event {
+ Event::Start(Tag::Link(lt, dest_url, title)) if !matches!(lt, LinkType::Email) => (
+ Event::Start(Tag::Link(lt, join_url(url.as_ref(), dest_url), title)),
+ range,
+ ),
+ Event::End(Tag::Link(lt, dest_url, title)) if !matches!(lt, LinkType::Email) => (
+ Event::End(Tag::Link(lt, join_url(url.as_ref(), dest_url), title)),
+ range,
+ ),
+ _ => (event, range),
+ });
+ Box::new(parser)
+}
+
+fn join_url<'a>(base: Option<&Url>, dest: CowStr<'a>) -> CowStr<'a> {
+ match base {
+ Some(base_url) => {
+ // Absolute URL or page-relative anchor doesn't need to be translated.
+ if dest.contains(':') || dest.starts_with('#') {
+ dest
+ } else {
+ let joined = base_url.join(&dest).unwrap_or_else(|e| {
+ panic!("failed to join URL `{}` to `{}`: {}", dest, base_url, e)
+ });
+ joined.into_string().into()
+ }
+ }
+ None => dest,
+ }
+}
+
+pub fn extract_section(file: &Path) -> Result {
+ let f = fs::File::open(file).with_context(|| format!("could not open `{}`", file.display()))?;
+ let mut f = io::BufReader::new(f);
+ let mut line = String::new();
+ f.read_line(&mut line)?;
+ if !line.starts_with("# ") {
+ bail!("expected input file to start with # header");
+ }
+ let (_name, section) = util::parse_name_and_section(&line[2..].trim()).with_context(|| {
+ format!(
+ "expected input file to have header with the format `# command-name(1)`, found: `{}`",
+ line
+ )
+ })?;
+ Ok(section)
+}
diff --git a/crates/mdman/src/main.rs b/crates/mdman/src/main.rs
new file mode 100644
index 00000000000..2bdf96d7230
--- /dev/null
+++ b/crates/mdman/src/main.rs
@@ -0,0 +1,133 @@
+use anyhow::{bail, format_err, Context, Error};
+use mdman::{Format, ManMap};
+use std::collections::HashMap;
+use std::path::{Path, PathBuf};
+use url::Url;
+
+/// Command-line options.
+struct Options {
+ format: Format,
+ output_dir: PathBuf,
+ sources: Vec,
+ url: Option,
+ man_map: ManMap,
+}
+
+fn main() {
+ if let Err(e) = run() {
+ eprintln!("error: {}", e);
+ for cause in e.chain().skip(1) {
+ eprintln!("\nCaused by:");
+ for line in cause.to_string().lines() {
+ if line.is_empty() {
+ eprintln!();
+ } else {
+ eprintln!(" {}", line);
+ }
+ }
+ }
+ std::process::exit(1);
+ }
+}
+
+fn run() -> Result<(), Error> {
+ let opts = process_args()?;
+ if !opts.output_dir.exists() {
+ std::fs::create_dir_all(&opts.output_dir).with_context(|| {
+ format!(
+ "failed to create output directory {}",
+ opts.output_dir.display()
+ )
+ })?;
+ }
+ for source in &opts.sources {
+ let section = mdman::extract_section(source)?;
+ let filename =
+ Path::new(source.file_name().unwrap()).with_extension(opts.format.extension(section));
+ let out_path = opts.output_dir.join(filename);
+ if same_file::is_same_file(source, &out_path).unwrap_or(false) {
+ bail!("cannot output to the same file as the source");
+ }
+ println!("Converting {} -> {}", source.display(), out_path.display());
+ let result = mdman::convert(&source, opts.format, opts.url.clone(), opts.man_map.clone())
+ .with_context(|| format!("failed to translate {}", source.display()))?;
+
+ std::fs::write(out_path, result)?;
+ }
+ Ok(())
+}
+
+fn process_args() -> Result {
+ let mut format = None;
+ let mut output = None;
+ let mut url = None;
+ let mut man_map: ManMap = HashMap::new();
+ let mut sources = Vec::new();
+ let mut args = std::env::args().skip(1);
+ while let Some(arg) = args.next() {
+ match arg.as_str() {
+ "-t" => {
+ format = match args.next().as_deref() {
+ Some("man") => Some(Format::Man),
+ Some("md") => Some(Format::Md),
+ Some("txt") => Some(Format::Text),
+ Some(s) => bail!("unknown output format: {}", s),
+ None => bail!("-t requires a value (man, md, txt)"),
+ };
+ }
+ "-o" => {
+ output = match args.next() {
+ Some(s) => Some(PathBuf::from(s)),
+ None => bail!("-o requires a value"),
+ };
+ }
+ "--url" => {
+ url = match args.next() {
+ Some(s) => {
+ let url = Url::parse(&s)
+ .with_context(|| format!("could not convert `{}` to a url", s))?;
+ if !url.path().ends_with('/') {
+ bail!("url `{}` should end with a /", url);
+ }
+ Some(url)
+ }
+ None => bail!("--url requires a value"),
+ }
+ }
+ "--man" => {
+ let man = args
+ .next()
+ .ok_or_else(|| format_err!("--man requires a value"))?;
+ let parts: Vec<_> = man.splitn(2, '=').collect();
+ let key_parts: Vec<_> = parts[0].splitn(2, ':').collect();
+ if parts.len() != 2 || key_parts.len() != 2 {
+ bail!("--man expected value with form name:1=link");
+ }
+ let section: u8 = key_parts[1].parse().with_context(|| {
+ format!("expected unsigned integer for section, got `{}`", parts[1])
+ })?;
+ man_map.insert((key_parts[0].to_string(), section), parts[1].to_string());
+ }
+ s => {
+ sources.push(PathBuf::from(s));
+ }
+ }
+ }
+ if format.is_none() {
+ bail!("-t must be specified (man, md, txt)");
+ }
+ if output.is_none() {
+ bail!("-o must be specified (output directory)");
+ }
+ if sources.is_empty() {
+ bail!("at least one source must be specified");
+ }
+ let opts = Options {
+ format: format.unwrap(),
+ output_dir: output.unwrap(),
+ sources,
+ url,
+ man_map,
+ };
+ Ok(opts)
+}
diff --git a/crates/mdman/src/util.rs b/crates/mdman/src/util.rs
new file mode 100644
index 00000000000..e85f22093a7
--- /dev/null
+++ b/crates/mdman/src/util.rs
@@ -0,0 +1,44 @@
+///! General utilities.
+use crate::EventIter;
+use anyhow::{bail, format_err, Context, Error};
+use pulldown_cmark::{CowStr, Event, Tag};
+
+/// Splits the text `foo(1)` into "foo" and `1`.
+pub fn parse_name_and_section(text: &str) -> Result<(&str, u8), Error> {
+ let mut i = text.split_terminator(&['(', ')'][..]);
+ let name = i
+ .next()
+ .ok_or_else(|| format_err!("man reference must have a name"))?;
+ let section = i
+ .next()
+ .ok_or_else(|| format_err!("man reference must have a section such as mycommand(1)"))?;
+ if let Some(s) = i.next() {
+ bail!(
+ "man reference must have the form mycommand(1), got extra part `{}`",
+ s
+ );
+ }
+ let section: u8 = section
+ .parse()
+ .with_context(|| format!("section must be a number, got {}", section))?;
+ Ok((name, section))
+}
+
+/// Extracts the text from a header after Tag::Heading has been received.
+pub fn header_text<'e>(parser: &mut EventIter<'e>) -> Result, Error> {
+ let text = match parser.next() {
+ Some((Event::Text(t), _range)) => t,
+ e => bail!("expected plain text in man header, got {:?}", e),
+ };
+ match parser.next() {
+ Some((Event::End(Tag::Heading(_)), _range)) => {
+ return Ok(text);
+ }
+ e => bail!("expected plain text in man header, got {:?}", e),
+ }
+}
+
+/// Removes tags from the front and back of a string.
+pub fn unwrap<'t>(text: &'t str, front: &str, back: &str) -> &'t str {
+ text.trim().trim_start_matches(front).trim_end_matches(back)
+}
diff --git a/crates/mdman/tests/compare.rs b/crates/mdman/tests/compare.rs
new file mode 100644
index 00000000000..3e679d1278a
--- /dev/null
+++ b/crates/mdman/tests/compare.rs
@@ -0,0 +1,48 @@
+//! Compares input to expected output.
+//!
+//! Use the MDMAN_BLESS environment variable to automatically update the
+//! expected output.
+
+use mdman::{Format, ManMap};
+use pretty_assertions::assert_eq;
+use std::path::PathBuf;
+use url::Url;
+
+fn run(name: &str) {
+ let input = PathBuf::from(format!("tests/compare/{}.md", name));
+ let url = Some(Url::parse("https://example.org/").unwrap());
+ let mut map = ManMap::new();
+ map.insert(
+ ("other-cmd".to_string(), 1),
+ "https://example.org/commands/other-cmd.html".to_string(),
+ );
+
+ for &format in &[Format::Man, Format::Md, Format::Text] {
+ let section = mdman::extract_section(&input).unwrap();
+ let result = mdman::convert(&input, format, url.clone(), map.clone()).unwrap();
+ let expected_path = format!(
+ "tests/compare/expected/{}.{}",
+ name,
+ format.extension(section)
+ );
+ if std::env::var("MDMAN_BLESS").is_ok() {
+ std::fs::write(&expected_path, result).unwrap();
+ } else {
+ let expected = std::fs::read_to_string(&expected_path).unwrap();
+ // Fix if Windows checked out with autocrlf.
+ let expected = expected.replace("\r\n", "\n");
+ assert_eq!(expected, result);
+ }
+ }
+}
+
+macro_rules! test( ($name:ident) => (
+ #[test]
+ fn $name() { run(stringify!($name)); }
+) );
+
+test!(formatting);
+test!(links);
+test!(options);
+test!(tables);
+test!(vars);
diff --git a/crates/mdman/tests/compare/expected/formatting.1 b/crates/mdman/tests/compare/expected/formatting.1
new file mode 100644
index 00000000000..dbd24526289
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/formatting.1
@@ -0,0 +1,118 @@
+'\" t
+.TH "FORMATTING" "1"
+.nh
+.ad l
+.ss \n[.ss] 0
+.sp
+This is \fBnested \f(BIformatting\fB \fBtext\fB\fR\&.
+.SH "SECOND HEADING"
+Some text at second level.
+.SS "Third heading"
+Some text at third level.
+.SS "Fourth heading"
+Some text at fourth level.
+.SH "Quotes and blocks."
+Here are some quotes and blocks.
+.RS 3
+.ll -5
+.sp
+This is a block quote. Ambidextrously koala apart that prudent blindly alas
+far amid dear goodness turgid so exact inside oh and alas much fanciful that
+dark on spoon\-fed adequately insolent walking crud.
+.br
+.RE
+.ll
+.sp
+.RS 4
+.nf
+This is a code block. Groundhog watchfully sudden firefly some self\-consciously hotly jeepers satanic after that this parrot this at virtuous
+some mocking the leaned jeez nightingale as much mallard so because jeez
+turned dear crud grizzly strenuously.
+
+ Indented and should be unmodified.
+.fi
+.RE
+.sp
+.RS 4
+.nf
+This is an indented code block. Egregiously yikes animatedly since outside beseechingly a badger hey shakily giraffe a one wow one this
+goodness regarding reindeer so astride before.
+
+ Doubly indented
+.fi
+.RE
+.SH "Lists"
+.sp
+.RS 4
+\h'-04' 1.\h'+01'Ordered list
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Unordered list
+.sp
+With a second paragraph inside it
+.sp
+.RS 4
+\h'-04' 1.\h'+01'Inner ordered list
+.RE
+.sp
+.RS 4
+\h'-04' 2.\h'+01'Another
+.RE
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Eggs
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Milk
+.sp
+.RS 4
+\h'-04' 5.\h'+01'Don't start at one.
+.RE
+.sp
+.RS 4
+\h'-04' 6.\h'+01'tamarind
+.RE
+.RE
+.RE
+.sp
+.RS 4
+\h'-04' 2.\h'+01'Second element
+.RE
+.sp
+.RS 4
+\h'-04' 3.\h'+01'Third element
+.RE
+.SH "Breaks"
+This has a
+.br
+hard break in it
+and a soft one.
+.SH "Horizontal rule"
+This should contain a line:
+\l'\n(.lu'
+.sp
+Nice!
+.SH "Strange characters"
+Handles escaping for characters
+.sp
+\&.dot at the start of a line.
+.sp
+\(rsfBnot really troff
+.sp
+Various characters \(rs \- \[en] \[em] \- | | `
+.sp
+.RS 4
+.nf
+tree
+`\-\- example
+ |\-\- salamander
+ | |\-\- honey
+ | `\-\- some
+ |\-\- fancifully
+ `\-\- trout
+.fi
+.RE
+.sp
+\ \ \ \ non\-breaking space.
diff --git a/crates/mdman/tests/compare/expected/formatting.md b/crates/mdman/tests/compare/expected/formatting.md
new file mode 100644
index 00000000000..6909bd44343
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/formatting.md
@@ -0,0 +1,94 @@
+# formatting(1)
+
+This is **nested _formatting_ `text`**.
+
+## SECOND HEADING
+
+Some text at second level.
+
+### Third heading
+
+Some text at third level.
+
+#### Fourth heading
+
+Some text at fourth level.
+
+## Quotes and blocks.
+
+Here are some quotes and blocks.
+
+> This is a block quote. Ambidextrously koala apart that prudent blindly alas
+> far amid dear goodness turgid so exact inside oh and alas much fanciful that
+> dark on spoon-fed adequately insolent walking crud.
+
+```
+This is a code block. Groundhog watchfully sudden firefly some self-consciously hotly jeepers satanic after that this parrot this at virtuous
+some mocking the leaned jeez nightingale as much mallard so because jeez
+turned dear crud grizzly strenuously.
+
+ Indented and should be unmodified.
+```
+
+ This is an indented code block. Egregiously yikes animatedly since outside beseechingly a badger hey shakily giraffe a one wow one this
+ goodness regarding reindeer so astride before.
+
+ Doubly indented
+
+## Lists
+
+1. Ordered list
+
+ * Unordered list
+
+ With a second paragraph inside it
+
+ 1. Inner ordered list
+
+ 1. Another
+
+ * Eggs
+
+ * Milk
+ 5. Don't start at one.
+ 6. tamarind
+
+1. Second element
+
+1. Third element
+
+## Breaks
+
+This has a\
+hard break in it
+and a soft one.
+
+## Horizontal rule
+
+This should contain a line:
+
+---
+
+Nice!
+
+## Strange characters
+
+Handles escaping for characters
+
+.dot at the start of a line.
+
+\fBnot really troff
+
+Various characters \ - – — ─ │ ├ └
+
+```
+tree
+└── example
+ ├── salamander
+ │ ├── honey
+ │ └── some
+ ├── fancifully
+ └── trout
+```
+
+ non-breaking space.
diff --git a/crates/mdman/tests/compare/expected/formatting.txt b/crates/mdman/tests/compare/expected/formatting.txt
new file mode 100644
index 00000000000..865b714b630
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/formatting.txt
@@ -0,0 +1,84 @@
+FORMATTING(1)
+
+This is nested formatting text.
+
+SECOND HEADING
+ Some text at second level.
+
+ Third heading
+ Some text at third level.
+
+ Fourth heading
+ Some text at fourth level.
+
+QUOTES AND BLOCKS.
+ Here are some quotes and blocks.
+
+ This is a block quote. Ambidextrously koala apart that prudent
+ blindly alas far amid dear goodness turgid so exact inside oh and
+ alas much fanciful that dark on spoon-fed adequately insolent walking
+ crud.
+
+ This is a code block. Groundhog watchfully sudden firefly some self-consciously hotly jeepers satanic after that this parrot this at virtuous
+ some mocking the leaned jeez nightingale as much mallard so because jeez
+ turned dear crud grizzly strenuously.
+
+ Indented and should be unmodified.
+
+ This is an indented code block. Egregiously yikes animatedly since outside beseechingly a badger hey shakily giraffe a one wow one this
+ goodness regarding reindeer so astride before.
+
+ Doubly indented
+
+LISTS
+ 1. Ordered list
+
+ o Unordered list
+
+ With a second paragraph inside it
+
+ 1. Inner ordered list
+
+ 2. Another
+
+ o Eggs
+
+ o Milk
+
+ 5. Don't start at one.
+
+ 6. tamarind
+
+ 2. Second element
+
+ 3. Third element
+
+BREAKS
+ This has a
+ hard break in it and a soft one.
+
+HORIZONTAL RULE
+ This should contain a line:
+
+ _________________________________________________________________
+ Nice!
+
+STRANGE CHARACTERS
+ Handles escaping for characters
+
+ .dot at the start of a line.
+
+ \fBnot really troff
+
+ Various characters \ - – — ─ │ ├ └
+
+ tree
+ └── example
+ ├── salamander
+ │ ├── honey
+ │ └── some
+ ├── fancifully
+ └── trout
+
+ non-breaking space.
+
diff --git a/crates/mdman/tests/compare/expected/links.1 b/crates/mdman/tests/compare/expected/links.1
new file mode 100644
index 00000000000..51520c0a3f6
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/links.1
@@ -0,0 +1,31 @@
+'\" t
+.TH "LINKS" "1"
+.nh
+.ad l
+.ss \n[.ss] 0
+.SH "NAME"
+links \- Test of different link kinds
+.SH "DESCRIPTION"
+Inline link: \fIinline link\fR
+.sp
+Reference link: \fIthis is a link\fR
+.sp
+Collapsed: \fIcollapsed\fR
+.sp
+Shortcut: \fIshortcut\fR
+.sp
+Autolink:
+.sp
+Email:
+.sp
+Relative link: \fIrelative link\fR
+.sp
+Collapsed unknown: [collapsed unknown][]
+.sp
+Reference unknown: [foo][unknown]
+.sp
+Shortcut unknown: [shortcut unknown]
+.sp
+\fBother\-cmd\fR(1)
+.sp
+\fBlocal\-cmd\fR(1)
diff --git a/crates/mdman/tests/compare/expected/links.md b/crates/mdman/tests/compare/expected/links.md
new file mode 100644
index 00000000000..b6b71d6c013
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/links.md
@@ -0,0 +1,35 @@
+# links(1)
+
+## NAME
+
+links - Test of different link kinds
+
+## DESCRIPTION
+
+Inline link: [inline link](https://example.com/inline)
+
+Reference link: [this is a link][bar]
+
+Collapsed: [collapsed][]
+
+Shortcut: [shortcut]
+
+Autolink:
+
+Email:
+
+Relative link: [relative link](foo/bar.html)
+
+Collapsed unknown: [collapsed unknown][]
+
+Reference unknown: [foo][unknown]
+
+Shortcut unknown: [shortcut unknown]
+
+[other-cmd(1)](https://example.org/commands/other-cmd.html)
+
+[local-cmd(1)](local-cmd.md)
+
+[bar]: https://example.com/bar
+[collapsed]: https://example.com/collapsed
+[shortcut]: https://example.com/shortcut
diff --git a/crates/mdman/tests/compare/expected/links.txt b/crates/mdman/tests/compare/expected/links.txt
new file mode 100644
index 00000000000..6475c037632
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/links.txt
@@ -0,0 +1,30 @@
+LINKS(1)
+
+NAME
+ links - Test of different link kinds
+
+DESCRIPTION
+ Inline link: inline link
+
+ Reference link: this is a link
+
+ Collapsed: collapsed
+
+ Shortcut: shortcut
+
+ Autolink:
+
+ Email:
+
+ Relative link: relative link
+
+ Collapsed unknown: [collapsed unknown][]
+
+ Reference unknown: [foo][unknown]
+
+ Shortcut unknown: [shortcut unknown]
+
+ other-cmd(1)
+
+ local-cmd(1)
+
diff --git a/crates/mdman/tests/compare/expected/options.1 b/crates/mdman/tests/compare/expected/options.1
new file mode 100644
index 00000000000..2d75cd25e9d
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/options.1
@@ -0,0 +1,94 @@
+'\" t
+.TH "MY\-COMMAND" "1"
+.nh
+.ad l
+.ss \n[.ss] 0
+.SH "NAME"
+my\-command \- A brief description
+.SH "SYNOPSIS"
+\fBmy\-command\fR [\fB\-\-abc\fR | \fB\-\-xyz\fR] \fIname\fR
+.br
+\fBmy\-command\fR [\fB\-f\fR \fIfile\fR]
+.br
+\fBmy\-command\fR (\fB\-m\fR | \fB\-M\fR) [\fIoldbranch\fR] \fInewbranch\fR
+.br
+\fBmy\-command\fR (\fB\-d\fR | \fB\-D\fR) [\fB\-r\fR] \fIbranchname\fR\&...
+.SH "DESCRIPTION"
+A description of the command.
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'One
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Sub one
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Sub two
+.RE
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Two
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'Three
+.RE
+.SH "OPTIONS"
+.SS "Command options"
+.sp
+\fB\-\-foo\-bar\fR
+.RS 4
+Demo \fIemphasis\fR, \fBstrong\fR, ~~strike~~
+.RE
+.sp
+\fB\-p\fR \fIspec\fR,
+\fB\-\-package\fR \fIspec\fR
+.RS 4
+This has multiple flags.
+.RE
+.sp
+\fInamed\-arg...\fR
+.RS 4
+A named argument.
+.RE
+.SS "Common Options"
+.sp
+\fB@\fR\fIfilename\fR
+.RS 4
+Load from filename.
+.RE
+.sp
+\fB\-\-foo\fR [\fIbar\fR]
+.RS 4
+Flag with optional value.
+.RE
+.sp
+\fB\-\-foo\fR[\fB=\fR\fIbar\fR]
+.RS 4
+Alternate syntax for optional value (with required = for disambiguation).
+.RE
+.SH "EXAMPLES"
+.sp
+.RS 4
+\h'-04' 1.\h'+01'An example
+.sp
+.RS 4
+.nf
+my\-command \-\-abc
+.fi
+.RE
+.RE
+.sp
+.RS 4
+\h'-04' 2.\h'+01'Another example
+.sp
+.RS 4
+.nf
+my\-command \-\-xyz
+.fi
+.RE
+.RE
+.SH "SEE ALSO"
+\fBother\-command\fR(1) \fBabc\fR(7)
diff --git a/crates/mdman/tests/compare/expected/options.md b/crates/mdman/tests/compare/expected/options.md
new file mode 100644
index 00000000000..3c08de57f1d
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/options.md
@@ -0,0 +1,77 @@
+# my-command(1)
+
+## NAME
+
+my-command - A brief description
+
+## SYNOPSIS
+
+`my-command` [`--abc` | `--xyz`] _name_\
+`my-command` [`-f` _file_]\
+`my-command` (`-m` | `-M`) [_oldbranch_] _newbranch_\
+`my-command` (`-d` | `-D`) [`-r`] _branchname_...
+
+## DESCRIPTION
+
+A description of the command.
+
+* One
+ * Sub one
+ * Sub two
+* Two
+* Three
+
+
+## OPTIONS
+
+### Command options
+
+
+
+--foo-bar
+Demo emphasis , strong , strike
+
+
+-p
spec
+--package
spec
+This has multiple flags.
+
+
+named-arg...
+A named argument.
+
+
+
+
+### Common Options
+
+
+@
filename
+Load from filename.
+
+
+--foo
[bar ]
+Flag with optional value.
+
+
+--foo
[=
bar ]
+Alternate syntax for optional value (with required = for disambiguation).
+
+
+
+
+
+## EXAMPLES
+
+1. An example
+
+ ```
+ my-command --abc
+ ```
+
+1. Another example
+
+ my-command --xyz
+
+## SEE ALSO
+[other-command(1)](other-command.md) [abc(7)](abc.md)
diff --git a/crates/mdman/tests/compare/expected/options.txt b/crates/mdman/tests/compare/expected/options.txt
new file mode 100644
index 00000000000..32ccfd249b8
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/options.txt
@@ -0,0 +1,57 @@
+MY-COMMAND(1)
+
+NAME
+ my-command - A brief description
+
+SYNOPSIS
+ my-command [--abc | --xyz] name
+ my-command [-f file]
+ my-command (-m | -M) [oldbranch] newbranch
+ my-command (-d | -D) [-r] branchname...
+
+DESCRIPTION
+ A description of the command.
+
+ o One
+ o Sub one
+
+ o Sub two
+
+ o Two
+
+ o Three
+
+OPTIONS
+ Command options
+ --foo-bar
+ Demo emphasis, strong, ~~strike~~
+
+ -p spec, --package spec
+ This has multiple flags.
+
+ named-arg...
+ A named argument.
+
+ Common Options
+ @filename
+ Load from filename.
+
+ --foo [bar]
+ Flag with optional value.
+
+ --foo[=bar]
+ Alternate syntax for optional value (with required = for
+ disambiguation).
+
+EXAMPLES
+ 1. An example
+
+ my-command --abc
+
+ 2. Another example
+
+ my-command --xyz
+
+SEE ALSO
+ other-command(1) abc(7)
+
diff --git a/crates/mdman/tests/compare/expected/tables.1 b/crates/mdman/tests/compare/expected/tables.1
new file mode 100644
index 00000000000..7175a3e85b8
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/tables.1
@@ -0,0 +1,108 @@
+'\" t
+.TH "TABLES" "1"
+.nh
+.ad l
+.ss \n[.ss] 0
+.SH "DESCRIPTION"
+Testing tables.
+
+.TS
+allbox tab(:);
+lt.
+T{
+Single col
+T}
+T{
+Hi! :)
+T}
+.TE
+.sp
+
+.TS
+allbox tab(:);
+lt lt lt.
+T{
+Header content
+T}:T{
+With \fBformat\fR \fItext\fR
+T}:T{
+Another column
+T}
+T{
+Some data
+T}:T{
+More data
+T}:T{
+
+T}
+T{
+Extra long amount of text within a column
+T}:T{
+hi
+T}:T{
+there
+T}
+.TE
+.sp
+
+.TS
+allbox tab(:);
+lt ct rt.
+T{
+Left aligned
+T}:T{
+Center aligned
+T}:T{
+Right aligned
+T}
+T{
+abc
+T}:T{
+def
+T}:T{
+ghi
+T}
+.TE
+.sp
+
+.TS
+allbox tab(:);
+lt ct rt.
+T{
+Left aligned
+T}:T{
+Center aligned
+T}:T{
+Right aligned
+T}
+T{
+X
+T}:T{
+X
+T}:T{
+X
+T}
+T{
+Extra long text 123456789012 with mixed widths.
+T}:T{
+Extra long text 123456789012 with mixed widths.
+T}:T{
+Extra long text 123456789012 with mixed widths.
+T}
+.TE
+.sp
+
+.TS
+allbox tab(:);
+lt.
+T{
+Link check
+T}
+T{
+\fIfoo\fR
+T}
+T{
+
+T}
+.TE
+.sp
diff --git a/crates/mdman/tests/compare/expected/tables.md b/crates/mdman/tests/compare/expected/tables.md
new file mode 100644
index 00000000000..831132c44ec
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/tables.md
@@ -0,0 +1,35 @@
+# tables(1)
+
+## DESCRIPTION
+
+Testing tables.
+
+| Single col |
+--------------
+| Hi! :) |
+
+
+Header content | With `format` *text* | Another column
+---------------|----------------------|----------------
+Some data | More data |
+Extra long amount of text within a column | hi | there
+
+
+Left aligned | Center aligned | Right aligned
+-------------|:--------------:|--------------:
+abc | def | ghi
+
+
+Left aligned | Center aligned | Right aligned
+-------------|:--------------:|--------------:
+X | X | X
+Extra long text 123456789012 with mixed widths. | Extra long text 123456789012 with mixed widths. | Extra long text 123456789012 with mixed widths.
+
+
+| Link check |
+--------------
+| [foo] |
+| |
+
+
+[foo]: https://example.com/
diff --git a/crates/mdman/tests/compare/expected/tables.txt b/crates/mdman/tests/compare/expected/tables.txt
new file mode 100644
index 00000000000..fed53f9a487
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/tables.txt
@@ -0,0 +1,45 @@
+TABLES(1)
+
+DESCRIPTION
+ Testing tables.
+
+ +-------------+
+ | Single col |
+ +-------------+
+ | Hi! :) |
+ +-------------+
+
+ +-------------------------------------+----------------+--------------+
+ | Header content | With format | Another |
+ | | text | column |
+ +-------------------------------------+----------------+--------------+
+ | Some data | More data | |
+ +-------------------------------------+----------------+--------------+
+ | Extra long amount of text within a | hi | there |
+ | column | | |
+ +-------------------------------------+----------------+--------------+
+
+ +---------------+-----------------+----------------+
+ | Left aligned | Center aligned | Right aligned |
+ +---------------+-----------------+----------------+
+ | abc | def | ghi |
+ +---------------+-----------------+----------------+
+
+ +-----------------------+-----------------------+-----------------------+
+ | Left aligned | Center aligned | Right aligned |
+ +-----------------------+-----------------------+-----------------------+
+ | X | X | X |
+ +-----------------------+-----------------------+-----------------------+
+ | Extra long text | Extra long text | Extra long text |
+ | 123456789012 with | 123456789012 with | 123456789012 with |
+ | mixed widths. | mixed widths. | mixed widths. |
+ +-----------------------+-----------------------+-----------------------+
+
+ +-----------------------+
+ | Link check |
+ +-----------------------+
+ | foo |
+ +-----------------------+
+ | https://example.com/ |
+ +-----------------------+
+
diff --git a/crates/mdman/tests/compare/expected/vars.7 b/crates/mdman/tests/compare/expected/vars.7
new file mode 100644
index 00000000000..0ee33ad3657
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/vars.7
@@ -0,0 +1,9 @@
+'\" t
+.TH "VARS" "7"
+.nh
+.ad l
+.ss \n[.ss] 0
+.sp
+Bar
+.sp
+bar
diff --git a/crates/mdman/tests/compare/expected/vars.md b/crates/mdman/tests/compare/expected/vars.md
new file mode 100644
index 00000000000..2493aca36f5
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/vars.md
@@ -0,0 +1,7 @@
+# vars(7)
+
+
+
+Bar
+
+bar
diff --git a/crates/mdman/tests/compare/expected/vars.txt b/crates/mdman/tests/compare/expected/vars.txt
new file mode 100644
index 00000000000..11d34ca1228
--- /dev/null
+++ b/crates/mdman/tests/compare/expected/vars.txt
@@ -0,0 +1,6 @@
+VARS(7)
+
+Bar
+
+bar
+
diff --git a/crates/mdman/tests/compare/formatting.md b/crates/mdman/tests/compare/formatting.md
new file mode 100644
index 00000000000..6909bd44343
--- /dev/null
+++ b/crates/mdman/tests/compare/formatting.md
@@ -0,0 +1,94 @@
+# formatting(1)
+
+This is **nested _formatting_ `text`**.
+
+## SECOND HEADING
+
+Some text at second level.
+
+### Third heading
+
+Some text at third level.
+
+#### Fourth heading
+
+Some text at fourth level.
+
+## Quotes and blocks.
+
+Here are some quotes and blocks.
+
+> This is a block quote. Ambidextrously koala apart that prudent blindly alas
+> far amid dear goodness turgid so exact inside oh and alas much fanciful that
+> dark on spoon-fed adequately insolent walking crud.
+
+```
+This is a code block. Groundhog watchfully sudden firefly some self-consciously hotly jeepers satanic after that this parrot this at virtuous
+some mocking the leaned jeez nightingale as much mallard so because jeez
+turned dear crud grizzly strenuously.
+
+ Indented and should be unmodified.
+```
+
+ This is an indented code block. Egregiously yikes animatedly since outside beseechingly a badger hey shakily giraffe a one wow one this
+ goodness regarding reindeer so astride before.
+
+ Doubly indented
+
+## Lists
+
+1. Ordered list
+
+ * Unordered list
+
+ With a second paragraph inside it
+
+ 1. Inner ordered list
+
+ 1. Another
+
+ * Eggs
+
+ * Milk
+ 5. Don't start at one.
+ 6. tamarind
+
+1. Second element
+
+1. Third element
+
+## Breaks
+
+This has a\
+hard break in it
+and a soft one.
+
+## Horizontal rule
+
+This should contain a line:
+
+---
+
+Nice!
+
+## Strange characters
+
+Handles escaping for characters
+
+.dot at the start of a line.
+
+\fBnot really troff
+
+Various characters \ - – — ─ │ ├ └
+
+```
+tree
+└── example
+ ├── salamander
+ │ ├── honey
+ │ └── some
+ ├── fancifully
+ └── trout
+```
+
+ non-breaking space.
diff --git a/crates/mdman/tests/compare/includes/options-common.md b/crates/mdman/tests/compare/includes/options-common.md
new file mode 100644
index 00000000000..07404e3f74c
--- /dev/null
+++ b/crates/mdman/tests/compare/includes/options-common.md
@@ -0,0 +1,14 @@
+{{#options}}
+{{#option "`@`_filename_"}}
+Load from filename.
+{{/option}}
+
+{{#option "`--foo` [_bar_]"}}
+Flag with optional value.
+{{/option}}
+
+{{#option "`--foo`[`=`_bar_]"}}
+Alternate syntax for optional value (with required = for disambiguation).
+{{/option}}
+
+{{/options}}
diff --git a/crates/mdman/tests/compare/links.md b/crates/mdman/tests/compare/links.md
new file mode 100644
index 00000000000..d0ef2204021
--- /dev/null
+++ b/crates/mdman/tests/compare/links.md
@@ -0,0 +1,35 @@
+# links(1)
+
+## NAME
+
+links - Test of different link kinds
+
+## DESCRIPTION
+
+Inline link: [inline link](https://example.com/inline)
+
+Reference link: [this is a link][bar]
+
+Collapsed: [collapsed][]
+
+Shortcut: [shortcut]
+
+Autolink:
+
+Email:
+
+Relative link: [relative link](foo/bar.html)
+
+Collapsed unknown: [collapsed unknown][]
+
+Reference unknown: [foo][unknown]
+
+Shortcut unknown: [shortcut unknown]
+
+{{man "other-cmd" 1}}
+
+{{man "local-cmd" 1}}
+
+[bar]: https://example.com/bar
+[collapsed]: https://example.com/collapsed
+[shortcut]: https://example.com/shortcut
diff --git a/crates/mdman/tests/compare/options.md b/crates/mdman/tests/compare/options.md
new file mode 100644
index 00000000000..51415b09e56
--- /dev/null
+++ b/crates/mdman/tests/compare/options.md
@@ -0,0 +1,62 @@
+# my-command(1)
+
+## NAME
+
+my-command - A brief description
+
+## SYNOPSIS
+
+`my-command` [`--abc` | `--xyz`] _name_\
+`my-command` [`-f` _file_]\
+`my-command` (`-m` | `-M`) [_oldbranch_] _newbranch_\
+`my-command` (`-d` | `-D`) [`-r`] _branchname_...
+
+## DESCRIPTION
+
+A description of the command.
+
+* One
+ * Sub one
+ * Sub two
+* Two
+* Three
+
+
+## OPTIONS
+
+### Command options
+
+{{#options}}
+
+{{#option "`--foo-bar`"}}
+Demo *emphasis*, **strong**, ~~strike~~
+{{/option}}
+
+{{#option "`-p` _spec_" "`--package` _spec_"}}
+This has multiple flags.
+{{/option}}
+
+{{#option "_named-arg..._"}}
+A named argument.
+{{/option}}
+
+{{/options}}
+
+### Common Options
+
+{{> options-common}}
+
+## EXAMPLES
+
+1. An example
+
+ ```
+ my-command --abc
+ ```
+
+1. Another example
+
+ my-command --xyz
+
+## SEE ALSO
+{{man "other-command" 1}} {{man "abc" 7}}
diff --git a/crates/mdman/tests/compare/tables.md b/crates/mdman/tests/compare/tables.md
new file mode 100644
index 00000000000..831132c44ec
--- /dev/null
+++ b/crates/mdman/tests/compare/tables.md
@@ -0,0 +1,35 @@
+# tables(1)
+
+## DESCRIPTION
+
+Testing tables.
+
+| Single col |
+--------------
+| Hi! :) |
+
+
+Header content | With `format` *text* | Another column
+---------------|----------------------|----------------
+Some data | More data |
+Extra long amount of text within a column | hi | there
+
+
+Left aligned | Center aligned | Right aligned
+-------------|:--------------:|--------------:
+abc | def | ghi
+
+
+Left aligned | Center aligned | Right aligned
+-------------|:--------------:|--------------:
+X | X | X
+Extra long text 123456789012 with mixed widths. | Extra long text 123456789012 with mixed widths. | Extra long text 123456789012 with mixed widths.
+
+
+| Link check |
+--------------
+| [foo] |
+| |
+
+
+[foo]: https://example.com/
diff --git a/crates/mdman/tests/compare/vars.md b/crates/mdman/tests/compare/vars.md
new file mode 100644
index 00000000000..d41b7658395
--- /dev/null
+++ b/crates/mdman/tests/compare/vars.md
@@ -0,0 +1,7 @@
+# vars(7)
+
+{{*set foo="Bar"}}
+
+{{foo}}
+
+{{lower foo}}
diff --git a/crates/mdman/tests/invalid.rs b/crates/mdman/tests/invalid.rs
new file mode 100644
index 00000000000..cc81d06c427
--- /dev/null
+++ b/crates/mdman/tests/invalid.rs
@@ -0,0 +1,34 @@
+//! Tests for errors and invalid input.
+
+use mdman::{Format, ManMap};
+use pretty_assertions::assert_eq;
+use std::path::PathBuf;
+
+fn run(name: &str, expected_error: &str) {
+ let input = PathBuf::from(format!("tests/invalid/{}", name));
+ match mdman::convert(&input, Format::Man, None, ManMap::new()) {
+ Ok(_) => {
+ panic!("expected {} to fail", name);
+ }
+ Err(e) => {
+ assert_eq!(expected_error, e.to_string());
+ }
+ }
+}
+
+macro_rules! test( ($name:ident, $file_name:expr, $error:expr) => (
+ #[test]
+ fn $name() { run($file_name, $error); }
+) );
+
+test!(
+ nested,
+ "nested.md",
+ "Error rendering \"template\" line 4, col 1: options blocks cannot be nested"
+);
+
+test!(
+ not_inside_options,
+ "not-inside-options.md",
+ "Error rendering \"template\" line 3, col 1: option must be in options block"
+);
diff --git a/crates/mdman/tests/invalid/nested.md b/crates/mdman/tests/invalid/nested.md
new file mode 100644
index 00000000000..6a33e6df6b4
--- /dev/null
+++ b/crates/mdman/tests/invalid/nested.md
@@ -0,0 +1,6 @@
+# nested(1)
+
+{{#options}}
+{{#options}}
+{{/options}}
+{{/options}}
diff --git a/crates/mdman/tests/invalid/not-inside-options.md b/crates/mdman/tests/invalid/not-inside-options.md
new file mode 100644
index 00000000000..b6c816f09dd
--- /dev/null
+++ b/crates/mdman/tests/invalid/not-inside-options.md
@@ -0,0 +1,5 @@
+# not-inside-options(1)
+
+{{#option "`-o`"}}
+Testing without options block.
+{{/option}}
diff --git a/src/doc/Makefile b/src/doc/Makefile
deleted file mode 100644
index 505532d2be8..00000000000
--- a/src/doc/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# This Makefile is used to build the Cargo man pages.
-#
-# The source for the man pages are located in src/doc/man in Asciidoctor
-# format. See https://asciidoctor.org/ for more information.
-#
-# Just run `make` and it will generate the man pages in src/etc/man and the
-# HTML pages in src/doc/man/generated.
-#
-# There are some Asciidoctor extensions, see the file `asciidoc-extensions.rb`
-# for the documentation.
-
-MAN_SOURCE = $(sort $(wildcard man/cargo*.adoc))
-COMMANDS = $(notdir $(MAN_SOURCE))
-HTML = $(patsubst %.adoc,man/generated/%.html,$(COMMANDS))
-MAN_LOCATION = ../etc/man
-MAN = $(patsubst %.adoc,$(MAN_LOCATION)/%.1,$(COMMANDS))
-ASCIIDOCOPTS = -r ./asciidoc-extension.rb
-OTHER_DEPS = asciidoc-extension.rb $(filter-out $(MAN_SOURCE),$(sort $(wildcard man/*.adoc)))
-
-all: commands-html man
-commands-html: $(HTML)
-man: $(MAN)
-
-$(HTML): man/generated/%.html : man/%.adoc asciidoc-extension.rb $(OTHER_DEPS)
- asciidoctor $(ASCIIDOCOPTS) -s $< -o $@
-
-$(MAN): $(MAN_LOCATION)/%.1 : man/%.adoc $(OTHER_DEPS)
- asciidoctor $(ASCIIDOCOPTS) -b manpage $< -o $@
diff --git a/src/doc/README.md b/src/doc/README.md
index 85da35bc84f..92bfd8a0580 100644
--- a/src/doc/README.md
+++ b/src/doc/README.md
@@ -1,17 +1,17 @@
# Cargo documentation
-This directory contains Cargo's documentation. There are two parts, [The Cargo Book]
-which is built with [mdbook] and the man pages, which are built with [Asciidoctor].
-The man pages are also included in The Cargo Book as HTML.
+This directory contains Cargo's documentation. There are two parts, [The Cargo
+Book] which is built with [mdbook] and the man pages, which are built with
+[mdman].
[The Cargo Book]: https://doc.rust-lang.org/cargo/
+[mdBook]: https://github.com/rust-lang/mdBook
+[mdman]: https://github.com/rust-lang/cargo/tree/master/crates/mdman/
### Building the book
Building the book requires [mdBook]. To get it:
-[mdBook]: https://github.com/rust-lang/mdBook
-
```console
$ cargo install mdbook
```
@@ -35,27 +35,27 @@ every file must be linked there.
### Building the man pages
-Building the man pages requires [Asciidoctor]. See the linked page for
-installation instructions. It also requires the `make` build tool and `ruby`.
+The man pages use a tool called [mdman] to convert markdown to a man page
+format. Check out the documentation at
+[`mdman/doc/`](../../crates/mdman/doc/)
+for more details.
-[Asciidoctor]: https://asciidoctor.org/
+The man pages are converted from a templated markdown (located in the
+[`src/doc/man/`](man)
+directory) to three different formats:
-The source files are located in the [`src/doc/man`](man) directory. The
-[`Makefile`](Makefile) is used to rebuild the man pages. It outputs the man
-pages into [`src/etc/man`](../etc/man) and the HTML versions into
-[`src/doc/man/generated`](man/generated). The Cargo Book has some markdown
-stub files in [`src/doc/src/commands`](src/commands) which load the generated
-HTML files.
+1. Troff-style man pages, saved in [`src/etc/man/`](../etc/man).
+2. Markdown (with some HTML) for the Cargo Book, saved in
+ [`src/doc/src/commands/`](src/commands).
+3. Plain text (needed for embedded man pages on platforms without man such as
+ Windows), saved in [`src/doc/man/generated_txt/`](man/generated_txt).
-To build the man pages, run `make` in the `src/doc` directory:
+To rebuild the man pages, run the script `build-man.sh` in the `src/doc` directory.
```console
-$ make
+$ ./build-man.sh
```
-The build script uses a few Asciidoctor extensions. See
-[`asciidoc-extension.rb`](asciidoc-extension.rb) for details.
-
## Contributing
We'd love your help with improving the documentation! Please feel free to
diff --git a/src/doc/asciidoc-extension.rb b/src/doc/asciidoc-extension.rb
deleted file mode 100644
index 1fc8e99d96b..00000000000
--- a/src/doc/asciidoc-extension.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
-
-include Asciidoctor
-
-# An inline macro that generates links to related man pages.
-#
-# Usage
-#
-# man:gittutorial[7]
-#
-class ManInlineMacro < Extensions::InlineMacroProcessor
- use_dsl
-
- named :man
- name_positional_attributes 'volnum'
-
- def process parent, target, attrs
- manname = target
- suffix = if (volnum = attrs['volnum'])
- "(#{volnum})"
- else
- nil
- end
- text = %(#{manname}#{suffix})
- if parent.document.basebackend? 'html'
- parent.document.register :links, target
- if manname == 'rustc'
- html_target = 'https://doc.rust-lang.org/rustc/index.html'
- elsif manname == 'rustdoc'
- html_target = 'https://doc.rust-lang.org/rustdoc/index.html'
- elsif manname == 'cargo'
- html_target = 'index.html'
- else
- html_target = %(#{manname}.html)
- end
- %(#{(create_anchor parent, text, type: :link, target: html_target).render})
- elsif parent.document.backend == 'manpage'
- %(\x1b\\fB#{manname}\x1b\\fP#{suffix})
- else
- text
- end
- end
-end
-
-# Creates a link to something in the cargo documentation.
-#
-# For HTML this creates a relative link. For the man page it gives a direct
-# link to doc.rust-lang.org.
-#
-# Usage
-#
-# linkcargo:reference/manifest.html[the manifest]
-#
-class LinkCargoInlineMacro < Extensions::InlineMacroProcessor
- use_dsl
-
- named :linkcargo
- name_positional_attributes 'text'
-
- def process parent, target, attrs
- text = attrs['text']
- if parent.document.basebackend? 'html'
- target = %(../#{target})
- parent.document.register :links, target
- %(#{(create_anchor parent, text, type: :link, target: target).render})
- elsif parent.document.backend == 'manpage'
- target = %(https://doc.rust-lang.org/cargo/#{target})
- %(#{(create_anchor parent, text, type: :link, target: target).render})
- else
- %(#{text} <#{target}>)
- end
- end
-end
-
-# Backticks in the manpage renderer use the CR font (courier), but in most
-# cases in a terminal this doesn't look any different. Instead, use bold which
-# should follow man page conventions better.
-class MonoPostprocessor < Extensions::Postprocessor
- def process document, output
- if document.basebackend? 'manpage'
- output = output.gsub(/\\f\(CR/, '\\fB')
- end
- output
- end
-end
-
-# Man pages are ASCII only. Unfortunately asciidoc doesn't process these
-# characters for us. The `cargo tree` manpage needs a little assistance.
-class SpecialCharPostprocessor < Extensions::Postprocessor
- def process document, output
- if document.basebackend? 'manpage'
- output = output.gsub(/│/, '|')
- .gsub(/├/, '|')
- .gsub(/└/, '`')
- .gsub(/─/, '\-')
- end
- output
- end
-end
-
-# General utility for converting text. Example:
-#
-# convert:lowercase[{somevar}]
-class ConvertInlineMacro < Extensions::InlineMacroProcessor
- use_dsl
-
- named :convert
- name_positional_attributes 'text'
-
- def process parent, target, attrs
- text = attrs['text']
- case target
- when 'lowercase'
- text.downcase
- end
- end
-end
-
-Extensions.register :uri_schemes do
- inline_macro ManInlineMacro
- inline_macro LinkCargoInlineMacro
- inline_macro ConvertInlineMacro
- postprocessor MonoPostprocessor
- postprocessor SpecialCharPostprocessor
-end
diff --git a/src/doc/build-man.sh b/src/doc/build-man.sh
new file mode 100755
index 00000000000..85f7e526de4
--- /dev/null
+++ b/src/doc/build-man.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# This script builds the Cargo man pages.
+#
+# The source for the man pages are located in src/doc/man/ in markdown format.
+# These also are handlebars templates, see crates/mdman/README.md for details.
+#
+# The generated man pages are placed in the src/etc/man/ directory. The pages
+# are also expanded into markdown (after being expanded by handlebars) and
+# saved in the src/doc/src/commands/ directory. These are included in the
+# Cargo book, which is converted to HTML by mdbook.
+
+set -e
+
+OPTIONS="--url https://doc.rust-lang.org/cargo/commands/ \
+ --man rustc:1=https://doc.rust-lang.org/rustc/index.html \
+ --man rustdoc:1=https://doc.rust-lang.org/rustdoc/index.html"
+
+cargo run --manifest-path=../../crates/mdman/Cargo.toml -- \
+ -t md -o src/commands man/cargo*.md \
+ $OPTIONS
+
+cargo run --manifest-path=../../crates/mdman/Cargo.toml -- \
+ -t txt -o man/generated_txt man/cargo*.md \
+ $OPTIONS
+
+cargo run --manifest-path=../../crates/mdman/Cargo.toml -- \
+ -t man -o ../etc/man man/cargo*.md \
+ $OPTIONS
diff --git a/src/doc/man/cargo-bench.adoc b/src/doc/man/cargo-bench.md
similarity index 59%
rename from src/doc/man/cargo-bench.adoc
rename to src/doc/man/cargo-bench.md
index 79acc6f2674..b47a1a079b4 100644
--- a/src/doc/man/cargo-bench.adoc
+++ b/src/doc/man/cargo-bench.md
@@ -1,27 +1,25 @@
-= cargo-bench(1)
-:idprefix: cargo_bench_
-:doctype: manpage
-:actionverb: Benchmark
-:nouns: benchmarks
+# cargo-bench(1)
+{{*set actionverb="Benchmark"}}
+{{*set nouns="benchmarks"}}
-== NAME
+## NAME
cargo-bench - Execute benchmarks of a package
-== SYNOPSIS
+## SYNOPSIS
-`cargo bench [_OPTIONS_] [BENCHNAME] [-- _BENCH-OPTIONS_]`
+`cargo bench` [_options_] [_benchname_] [`--` _bench-options_]
-== DESCRIPTION
+## DESCRIPTION
Compile and execute benchmarks.
-The benchmark filtering argument `BENCHNAME` and all the arguments following
+The benchmark filtering argument _benchname_ and all the arguments following
the two dashes (`--`) are passed to the benchmark binaries and thus to
-_libtest_ (rustc's built in unit-test and micro-benchmarking framework). If
-you're passing arguments to both Cargo and the binary, the ones after `--` go
-to the binary, the ones before go to Cargo. For details about libtest's
-arguments see the output of `cargo bench \-- --help`. As an example, this will
+_libtest_ (rustc's built in unit-test and micro-benchmarking framework). If
+you are passing arguments to both Cargo and the binary, the ones after `--` go
+to the binary, the ones before go to Cargo. For details about libtest's
+arguments see the output of `cargo bench -- --help`. As an example, this will
run only the benchmark named `foo` (and skip other similarly named benchmarks
like `foobar`):
@@ -36,27 +34,24 @@ The libtest harness may be disabled by setting `harness = false` in the target
manifest settings, in which case your code will need to provide its own `main`
function to handle running benchmarks.
-
> **Note**: The
-> link:https://doc.rust-lang.org/nightly/unstable-book/library-features/test.html[`#[bench\]` attribute]
+> [`#[bench]` attribute](https://doc.rust-lang.org/nightly/unstable-book/library-features/test.html)
> is currently unstable and only available on the
-> link:https://doc.rust-lang.org/book/appendix-07-nightly-rust.html[nightly channel].
+> [nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html).
> There are some packages available on
-> link:https://crates.io/keywords/benchmark[crates.io] that may help with
+> [crates.io](https://crates.io/keywords/benchmark) that may help with
> running benchmarks on the stable channel, such as
-> link:https://crates.io/crates/criterion[Criterion].
-
-== OPTIONS
+> [Criterion](https://crates.io/crates/criterion).
-=== Benchmark Options
+## OPTIONS
-include::options-test.adoc[]
+### Benchmark Options
-=== Package Selection
+{{> options-test }}
-include::options-packages.adoc[]
+{{> section-package-selection }}
-=== Target Selection
+### Target Selection
When no target selection options are given, `cargo bench` will build the
following targets of the selected packages:
@@ -75,19 +70,25 @@ them from being benchmarked by default. Target selection options that take a
target by name ignore the `bench` flag and will always benchmark the given
target.
-include::options-targets.adoc[]
+{{> options-targets }}
+
+{{> section-features }}
-include::options-features.adoc[]
+### Compilation Options
-=== Compilation Options
+{{#options}}
-include::options-target-triple.adoc[]
+{{> options-target-triple }}
-=== Output Options
+{{/options}}
-include::options-target-dir.adoc[]
+### Output Options
-=== Display Options
+{{#options}}
+{{> options-target-dir }}
+{{/options}}
+
+### Display Options
By default the Rust test harness hides output from benchmark execution to keep
results readable. Benchmark output can be recovered (e.g., for debugging) by
@@ -95,33 +96,39 @@ passing `--nocapture` to the benchmark binaries:
cargo bench -- --nocapture
-include::options-display.adoc[]
+{{#options}}
+
+{{> options-display }}
-include::options-message-format.adoc[]
+{{> options-message-format }}
-=== Manifest Options
+{{/options}}
-include::options-manifest-path.adoc[]
+### Manifest Options
-include::options-locked.adoc[]
+{{#options}}
+{{> options-manifest-path }}
-=== Common Options
+{{> options-locked }}
+{{/options}}
-include::options-common.adoc[]
+{{> section-options-common }}
-=== Miscellaneous Options
+### Miscellaneous Options
The `--jobs` argument affects the building of the benchmark executable but
does not affect how many threads are used when running the benchmarks. The
Rust test harness runs benchmarks serially in a single thread.
-include::options-jobs.adoc[]
+{{#options}}
+{{> options-jobs }}
+{{/options}}
-== PROFILES
+## PROFILES
Profiles may be used to configure compiler options such as optimization levels
and debug settings. See
-linkcargo:reference/profiles.html[the reference]
+[the reference](../reference/profiles.html)
for more details.
Benchmarks are always built with the `bench` profile. Binary and lib targets
@@ -130,23 +137,23 @@ are built with the `release` profiles when linked to binaries and benchmarks.
Dependencies use the `release` profile.
If you need a debug build of a benchmark, try building it with
-man:cargo-build[1] which will use the `test` profile which is by default
+{{man "cargo-build" 1}} which will use the `test` profile which is by default
unoptimized and includes debug information. You can then run the debug-enabled
benchmark manually.
-include::section-environment.adoc[]
+{{> section-environment }}
-include::section-exit-status.adoc[]
+{{> section-exit-status }}
-== EXAMPLES
+## EXAMPLES
-. Build and execute all the benchmarks of the current package:
+1. Build and execute all the benchmarks of the current package:
- cargo bench
+ cargo bench
-. Run only a specific benchmark within a specific benchmark target:
+2. Run only a specific benchmark within a specific benchmark target:
- cargo bench --bench bench_name -- modname::some_benchmark
+ cargo bench --bench bench_name -- modname::some_benchmark
-== SEE ALSO
-man:cargo[1], man:cargo-test[1]
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-test" 1}}
diff --git a/src/doc/man/cargo-build.adoc b/src/doc/man/cargo-build.adoc
deleted file mode 100644
index a7b20d7de64..00000000000
--- a/src/doc/man/cargo-build.adoc
+++ /dev/null
@@ -1,98 +0,0 @@
-= cargo-build(1)
-:idprefix: cargo_build_
-:doctype: manpage
-:actionverb: Build
-
-== NAME
-
-cargo-build - Compile the current package
-
-== SYNOPSIS
-
-`cargo build [_OPTIONS_]`
-
-== DESCRIPTION
-
-Compile local packages and all of their dependencies.
-
-== OPTIONS
-
-=== Package Selection
-
-include::options-packages.adoc[]
-
-=== Target Selection
-
-When no target selection options are given, `cargo build` will build all
-binary and library targets of the selected packages. Binaries are skipped if
-they have `required-features` that are missing.
-
-include::options-targets.adoc[]
-
-include::options-features.adoc[]
-
-=== Compilation Options
-
-include::options-target-triple.adoc[]
-
-include::options-release.adoc[]
-
-=== Output Options
-
-include::options-target-dir.adoc[]
-
-*--out-dir* _DIRECTORY_::
- Copy final artifacts to this directory.
-+
-This option is unstable and available only on the
-link:https://doc.rust-lang.org/book/appendix-07-nightly-rust.html[nightly channel]
-and requires the `-Z unstable-options` flag to enable.
-See https://github.com/rust-lang/cargo/issues/6790 for more information.
-
-=== Display Options
-
-include::options-display.adoc[]
-
-include::options-message-format.adoc[]
-
-*--build-plan*::
- Outputs a series of JSON messages to stdout that indicate the commands to
- run the build.
-+
-This option is unstable and available only on the
-link:https://doc.rust-lang.org/book/appendix-07-nightly-rust.html[nightly channel]
-and requires the `-Z unstable-options` flag to enable.
-See https://github.com/rust-lang/cargo/issues/5579 for more information.
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-=== Miscellaneous Options
-
-include::options-jobs.adoc[]
-
-include::section-profiles.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Build the local package and all of its dependencies:
-
- cargo build
-
-. Build with optimizations:
-
- cargo build --release
-
-== SEE ALSO
-man:cargo[1], man:cargo-rustc[1]
diff --git a/src/doc/man/cargo-build.md b/src/doc/man/cargo-build.md
new file mode 100644
index 00000000000..fb24c5a000b
--- /dev/null
+++ b/src/doc/man/cargo-build.md
@@ -0,0 +1,107 @@
+# cargo-build(1)
+{{*set actionverb="Build"}}
+
+## NAME
+
+cargo-build - Compile the current package
+
+## SYNOPSIS
+
+`cargo build` [_options_]
+
+## DESCRIPTION
+
+Compile local packages and all of their dependencies.
+
+## OPTIONS
+
+{{> section-package-selection }}
+
+### Target Selection
+
+When no target selection options are given, `cargo build` will build all
+binary and library targets of the selected packages. Binaries are skipped if
+they have `required-features` that are missing.
+
+{{> options-targets }}
+
+{{> section-features }}
+
+### Compilation Options
+
+{{#options}}
+
+{{> options-target-triple }}
+
+{{> options-release }}
+
+{{/options}}
+
+### Output Options
+
+{{#options}}
+{{> options-target-dir }}
+
+{{#option "`--out-dir` _directory_" }}
+Copy final artifacts to this directory.
+
+This option is unstable and available only on the
+[nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
+and requires the `-Z unstable-options` flag to enable.
+See https://github.com/rust-lang/cargo/issues/6790 for more information.
+{{/option}}
+
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+
+{{> options-message-format }}
+
+{{#option "`--build-plan`" }}
+Outputs a series of JSON messages to stdout that indicate the commands to run
+the build.
+
+This option is unstable and available only on the
+[nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
+and requires the `-Z unstable-options` flag to enable.
+See for more information.
+{{/option}}
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+{{> options-manifest-path }}
+
+{{> options-locked }}
+{{/options}}
+
+{{> section-options-common }}
+
+### Miscellaneous Options
+
+{{#options}}
+{{> options-jobs }}
+{{/options}}
+
+{{> section-profiles }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Build the local package and all of its dependencies:
+
+ cargo build
+
+2. Build with optimizations:
+
+ cargo build --release
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-rustc" 1}}
diff --git a/src/doc/man/cargo-check.adoc b/src/doc/man/cargo-check.adoc
deleted file mode 100644
index c84b1dcef4c..00000000000
--- a/src/doc/man/cargo-check.adoc
+++ /dev/null
@@ -1,87 +0,0 @@
-= cargo-check(1)
-:idprefix: cargo_check_
-:doctype: manpage
-:actionverb: Check
-
-== NAME
-
-cargo-check - Check the current package
-
-== SYNOPSIS
-
-`cargo check [_OPTIONS_]`
-
-== DESCRIPTION
-
-Check a local package and all of its dependencies for errors. This will
-essentially compile the packages without performing the final step of code
-generation, which is faster than running `cargo build`. The compiler will save
-metadata files to disk so that future runs will reuse them if the source has
-not been modified.
-
-== OPTIONS
-
-=== Package Selection
-
-include::options-packages.adoc[]
-
-=== Target Selection
-
-When no target selection options are given, `cargo check` will check all
-binary and library targets of the selected packages. Binaries are skipped if
-they have `required-features` that are missing.
-
-include::options-targets.adoc[]
-
-include::options-features.adoc[]
-
-=== Compilation Options
-
-include::options-target-triple.adoc[]
-
-include::options-release.adoc[]
-
-include::options-profile.adoc[]
-
-=== Output Options
-
-include::options-target-dir.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-include::options-message-format.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-=== Miscellaneous Options
-
-include::options-jobs.adoc[]
-
-include::section-profiles.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Check the local package for errors:
-
- cargo check
-
-. Check all targets, including unit tests:
-
- cargo check --all-targets --profile=test
-
-== SEE ALSO
-man:cargo[1], man:cargo-build[1]
diff --git a/src/doc/man/cargo-check.md b/src/doc/man/cargo-check.md
new file mode 100644
index 00000000000..b012e25020c
--- /dev/null
+++ b/src/doc/man/cargo-check.md
@@ -0,0 +1,93 @@
+# cargo-check(1)
+{{*set actionverb="Check"}}
+
+## NAME
+
+cargo-check - Check the current package
+
+## SYNOPSIS
+
+`cargo check` [_options_]
+
+## DESCRIPTION
+
+Check a local package and all of its dependencies for errors. This will
+essentially compile the packages without performing the final step of code
+generation, which is faster than running `cargo build`. The compiler will save
+metadata files to disk so that future runs will reuse them if the source has
+not been modified.
+
+## OPTIONS
+
+{{> section-package-selection }}
+
+### Target Selection
+
+When no target selection options are given, `cargo check` will check all
+binary and library targets of the selected packages. Binaries are skipped if
+they have `required-features` that are missing.
+
+{{> options-targets }}
+
+{{> section-features }}
+
+### Compilation Options
+
+{{#options}}
+
+{{> options-target-triple }}
+
+{{> options-release }}
+
+{{> options-profile }}
+
+{{/options}}
+
+### Output Options
+
+{{#options}}
+{{> options-target-dir }}
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+
+{{> options-message-format }}
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+{{> options-manifest-path }}
+
+{{> options-locked }}
+{{/options}}
+
+{{> section-options-common }}
+
+### Miscellaneous Options
+
+{{#options}}
+{{> options-jobs }}
+{{/options}}
+
+{{> section-profiles }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Check the local package for errors:
+
+ cargo check
+
+2. Check all targets, including unit tests:
+
+ cargo check --all-targets --profile=test
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-build" 1}}
diff --git a/src/doc/man/cargo-clean.adoc b/src/doc/man/cargo-clean.adoc
deleted file mode 100644
index 08fdb76deb3..00000000000
--- a/src/doc/man/cargo-clean.adoc
+++ /dev/null
@@ -1,76 +0,0 @@
-= cargo-clean(1)
-:idprefix: cargo_clean_
-:doctype: manpage
-:actionverb: Clean
-
-== NAME
-
-cargo-clean - Remove generated artifacts
-
-== SYNOPSIS
-
-`cargo clean [_OPTIONS_]`
-
-== DESCRIPTION
-
-Remove artifacts from the target directory that Cargo has generated in the
-past.
-
-With no options, `cargo clean` will delete the entire target directory.
-
-== OPTIONS
-
-=== Package Selection
-
-When no packages are selected, all packages and all dependencies in the
-workspace are cleaned.
-
-*-p* _SPEC_...::
-*--package* _SPEC_...::
- Clean only the specified packages. This flag may be specified
- multiple times. See man:cargo-pkgid[1] for the SPEC format.
-
-=== Clean Options
-
-*--doc*::
- This option will cause `cargo clean` to remove only the `doc` directory in
- the target directory.
-
-*--release*::
- Clean all artifacts that were built with the `release` or `bench`
- profiles.
-
-include::options-target-dir.adoc[]
-
-include::options-target-triple.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Remove the entire target directory:
-
- cargo clean
-
-. Remove only the release artifacts:
-
- cargo clean --release
-
-== SEE ALSO
-man:cargo[1], man:cargo-build[1]
diff --git a/src/doc/man/cargo-clean.md b/src/doc/man/cargo-clean.md
new file mode 100644
index 00000000000..d7d50840a9c
--- /dev/null
+++ b/src/doc/man/cargo-clean.md
@@ -0,0 +1,83 @@
+# cargo-clean(1)
+{{*set actionverb="Clean"}}
+
+## NAME
+
+cargo-clean - Remove generated artifacts
+
+## SYNOPSIS
+
+`cargo clean` [_options_]
+
+## DESCRIPTION
+
+Remove artifacts from the target directory that Cargo has generated in the
+past.
+
+With no options, `cargo clean` will delete the entire target directory.
+
+## OPTIONS
+
+### Package Selection
+
+When no packages are selected, all packages and all dependencies in the
+workspace are cleaned.
+
+{{#options}}
+{{#option "`-p` _spec_..." "`--package` _spec_..." }}
+Clean only the specified packages. This flag may be specified
+multiple times. See {{man "cargo-pkgid" 1}} for the SPEC format.
+{{/option}}
+{{/options}}
+
+### Clean Options
+
+{{#options}}
+
+{{#option "`--doc`" }}
+This option will cause `cargo clean` to remove only the `doc` directory in
+the target directory.
+{{/option}}
+
+{{#option "`--release`" }}
+Clean all artifacts that were built with the `release` or `bench` profiles.
+{{/option}}
+
+{{> options-target-dir }}
+
+{{> options-target-triple }}
+
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+{{> options-manifest-path }}
+
+{{> options-locked }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Remove the entire target directory:
+
+ cargo clean
+
+2. Remove only the release artifacts:
+
+ cargo clean --release
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-build" 1}}
diff --git a/src/doc/man/cargo-doc.adoc b/src/doc/man/cargo-doc.adoc
deleted file mode 100644
index 70e37dff913..00000000000
--- a/src/doc/man/cargo-doc.adoc
+++ /dev/null
@@ -1,97 +0,0 @@
-= cargo-doc(1)
-:idprefix: cargo_doc_
-:doctype: manpage
-:actionverb: Document
-
-== NAME
-
-cargo-doc - Build a package's documentation
-
-== SYNOPSIS
-
-`cargo doc [_OPTIONS_]`
-
-== DESCRIPTION
-
-Build the documentation for the local package and all dependencies. The output
-is placed in `target/doc` in rustdoc's usual format.
-
-== OPTIONS
-
-=== Documentation 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.
-
-*--no-deps*::
- Do not build documentation for dependencies.
-
-*--document-private-items*::
- Include non-public items in the documentation.
-
-=== Package Selection
-
-include::options-packages.adoc[]
-
-=== Target Selection
-
-When no target selection options are given, `cargo doc` will document all
-binary and library targets of the selected package. The binary will be skipped
-if its name is the same as the lib target. Binaries are skipped if they have
-`required-features` that are missing.
-
-The default behavior can be changed by setting `doc = false` for the target in
-the manifest settings. Using target selection options will ignore the `doc`
-flag and will always document the given target.
-
-include::options-targets-lib-bin.adoc[]
-
-include::options-features.adoc[]
-
-=== Compilation Options
-
-include::options-target-triple.adoc[]
-
-include::options-release.adoc[]
-
-=== Output Options
-
-include::options-target-dir.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-include::options-message-format.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-=== Miscellaneous Options
-
-include::options-jobs.adoc[]
-
-include::section-profiles.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Build the local package documentation and its dependencies and output to
-`target/doc`.
-
- cargo doc
-
-== SEE ALSO
-man:cargo[1], man:cargo-rustdoc[1], man:rustdoc[1]
diff --git a/src/doc/man/cargo-doc.md b/src/doc/man/cargo-doc.md
new file mode 100644
index 00000000000..20a9c2589d1
--- /dev/null
+++ b/src/doc/man/cargo-doc.md
@@ -0,0 +1,111 @@
+# cargo-doc(1)
+{{*set actionverb="Document"}}
+
+## NAME
+
+cargo-doc - Build a package's documentation
+
+## SYNOPSIS
+
+`cargo doc` [_options_]
+
+## DESCRIPTION
+
+Build the documentation for the local package and all dependencies. The output
+is placed in `target/doc` in rustdoc's usual format.
+
+## OPTIONS
+
+### Documentation Options
+
+{{#options}}
+
+{{#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.
+{{/option}}
+
+{{#option "`--no-deps`" }}
+Do not build documentation for dependencies.
+{{/option}}
+
+{{#option "`--document-private-items`" }}
+Include non-public items in the documentation.
+{{/option}}
+
+{{/options}}
+
+{{> section-package-selection }}
+
+### Target Selection
+
+When no target selection options are given, `cargo doc` will document all
+binary and library targets of the selected package. The binary will be skipped
+if its name is the same as the lib target. Binaries are skipped if they have
+`required-features` that are missing.
+
+The default behavior can be changed by setting `doc = false` for the target in
+the manifest settings. Using target selection options will ignore the `doc`
+flag and will always document the given target.
+
+{{#options}}
+{{> options-targets-lib-bin }}
+{{/options}}
+
+{{> section-features }}
+
+### Compilation Options
+
+{{#options}}
+
+{{> options-target-triple }}
+
+{{> options-release }}
+
+{{/options}}
+
+### Output Options
+
+{{#options}}
+{{> options-target-dir }}
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+
+{{> options-message-format }}
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+{{> options-manifest-path }}
+
+{{> options-locked }}
+{{/options}}
+
+{{> section-options-common }}
+
+### Miscellaneous Options
+
+{{#options}}
+{{> options-jobs }}
+{{/options}}
+
+{{> section-profiles }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Build the local package documentation and its dependencies and output to
+ `target/doc`.
+
+ cargo doc
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-rustdoc" 1}}, {{man "rustdoc" 1}}
diff --git a/src/doc/man/cargo-fetch.adoc b/src/doc/man/cargo-fetch.md
similarity index 50%
rename from src/doc/man/cargo-fetch.adoc
rename to src/doc/man/cargo-fetch.md
index 3a12882b13e..2cca5f79748 100644
--- a/src/doc/man/cargo-fetch.adoc
+++ b/src/doc/man/cargo-fetch.md
@@ -1,17 +1,15 @@
-= cargo-fetch(1)
-:idprefix: cargo_fetch_
-:doctype: manpage
-:actionverb: Fetch
+# cargo-fetch(1)
+{{*set actionverb="Fetch"}}
-== NAME
+## NAME
cargo-fetch - Fetch dependencies of a package from the network
-== SYNOPSIS
+## SYNOPSIS
-`cargo fetch [_OPTIONS_]`
+`cargo fetch` [_options_]
-== DESCRIPTION
+## DESCRIPTION
If a `Cargo.lock` file is available, this command will ensure that all of the
git dependencies and/or registry dependencies are downloaded and locally
@@ -23,39 +21,43 @@ file before fetching the dependencies.
If `--target` is not specified, then all target dependencies are fetched.
-See also the link:https://crates.io/crates/cargo-prefetch[cargo-prefetch]
+See also the [cargo-prefetch](https://crates.io/crates/cargo-prefetch)
plugin which adds a command to download popular crates. This may be useful if
you plan to use Cargo without a network with the `--offline` flag.
-== OPTIONS
+## OPTIONS
-=== Fetch options
+### Fetch options
-include::options-target-triple.adoc[]
+{{#options}}
+{{> options-target-triple }}
+{{/options}}
-=== Display Options
+### Display Options
-include::options-display.adoc[]
+{{#options}}
+{{> options-display }}
+{{/options}}
-=== Manifest Options
+### Manifest Options
-include::options-manifest-path.adoc[]
+{{#options}}
+{{> options-manifest-path }}
-include::options-locked.adoc[]
+{{> options-locked }}
+{{/options}}
-=== Common Options
+{{> section-options-common }}
-include::options-common.adoc[]
+{{> section-environment }}
-include::section-environment.adoc[]
+{{> section-exit-status }}
-include::section-exit-status.adoc[]
+## EXAMPLES
-== EXAMPLES
+1. Fetch all dependencies:
-. Fetch all dependencies:
+ cargo fetch
- cargo fetch
-
-== SEE ALSO
-man:cargo[1], man:cargo-update[1], man:cargo-generate-lockfile[1]
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-update" 1}}, {{man "cargo-generate-lockfile" 1}}
diff --git a/src/doc/man/cargo-fix.adoc b/src/doc/man/cargo-fix.adoc
deleted file mode 100644
index 0cc8c3da4f8..00000000000
--- a/src/doc/man/cargo-fix.adoc
+++ /dev/null
@@ -1,142 +0,0 @@
-= cargo-fix(1)
-:idprefix: cargo_fix_
-:doctype: manpage
-:actionverb: Fix
-
-== NAME
-
-cargo-fix - Automatically fix lint warnings reported by rustc
-
-== SYNOPSIS
-
-`cargo fix [_OPTIONS_]`
-
-== DESCRIPTION
-
-This Cargo subcommand will automatically take rustc's suggestions from
-diagnostics like warnings and apply them to your source code. This is intended
-to help automate tasks that rustc itself already knows how to tell you to fix!
-The `cargo fix` subcommand is also being developed for the Rust 2018 edition
-to provide code the ability to easily opt-in to the new edition without having
-to worry about any breakage.
-
-Executing `cargo fix` will under the hood execute man:cargo-check[1]. Any warnings
-applicable to your crate will be automatically fixed (if possible) and all
-remaining warnings will be displayed when the check process is finished. For
-example if you'd like to prepare for the 2018 edition, you can do so by
-executing:
-
- cargo fix --edition
-
-which behaves the same as `cargo check --all-targets`.
-
-`cargo fix` is only capable of fixing code that is normally compiled with
-`cargo check`. If code is conditionally enabled with optional features, you
-will need to enable those features for that code to be analyzed:
-
- cargo fix --edition --features foo
-
-Similarly, other `cfg` expressions like platform-specific code will need to
-pass `--target` to fix code for the given target.
-
- cargo fix --edition --target x86_64-pc-windows-gnu
-
-If you encounter any problems with `cargo fix` or otherwise have any questions
-or feature requests please don't hesitate to file an issue at
-https://github.com/rust-lang/cargo
-
-== OPTIONS
-
-=== Fix options
-
-*--broken-code*::
- Fix code even if it already has compiler errors. This is useful if `cargo
- fix` fails to apply the changes. It will apply the changes and leave the
- broken code in the working directory for you to inspect and manually fix.
-
-*--edition*::
- Apply changes that will update the code to the latest edition. This will
- not update the edition in the `Cargo.toml` manifest, which must be updated
- manually.
-
-*--edition-idioms*::
- Apply suggestions that will update code to the preferred style for the
- current edition.
-
-*--allow-no-vcs*::
- Fix code even if a VCS was not detected.
-
-*--allow-dirty*::
- Fix code even if the working directory has changes.
-
-*--allow-staged*::
- Fix code even if the working directory has staged changes.
-
-=== Package Selection
-
-include::options-packages.adoc[]
-
-=== Target Selection
-
-When no target selection options are given, `cargo fix` will fix all targets
-(`--all-targets` implied). Binaries are skipped if they have
-`required-features` that are missing.
-
-include::options-targets.adoc[]
-
-include::options-features.adoc[]
-
-=== Compilation Options
-
-include::options-target-triple.adoc[]
-
-include::options-release.adoc[]
-
-include::options-profile.adoc[]
-
-=== Output Options
-
-include::options-target-dir.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-include::options-message-format.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-=== Miscellaneous Options
-
-include::options-jobs.adoc[]
-
-include::section-profiles.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Apply compiler suggestions to the local package:
-
- cargo fix
-
-. Convert a 2015 edition to 2018:
-
- cargo fix --edition
-
-. Apply suggested idioms for the current edition:
-
- cargo fix --edition-idioms
-
-== SEE ALSO
-man:cargo[1], man:cargo-check[1]
diff --git a/src/doc/man/cargo-fix.md b/src/doc/man/cargo-fix.md
new file mode 100644
index 00000000000..606fe1acd62
--- /dev/null
+++ b/src/doc/man/cargo-fix.md
@@ -0,0 +1,158 @@
+# cargo-fix(1)
+{{*set actionverb="Fix"}}
+
+## NAME
+
+cargo-fix - Automatically fix lint warnings reported by rustc
+
+## SYNOPSIS
+
+`cargo fix` [_options_]
+
+## DESCRIPTION
+
+This Cargo subcommand will automatically take rustc's suggestions from
+diagnostics like warnings and apply them to your source code. This is intended
+to help automate tasks that rustc itself already knows how to tell you to fix!
+The `cargo fix` subcommand is also being developed for the Rust 2018 edition
+to provide code the ability to easily opt-in to the new edition without having
+to worry about any breakage.
+
+Executing `cargo fix` will under the hood execute {{man "cargo-check" 1}}. Any warnings
+applicable to your crate will be automatically fixed (if possible) and all
+remaining warnings will be displayed when the check process is finished. For
+example if you'd like to prepare for the 2018 edition, you can do so by
+executing:
+
+ cargo fix --edition
+
+which behaves the same as `cargo check --all-targets`.
+
+`cargo fix` is only capable of fixing code that is normally compiled with
+`cargo check`. If code is conditionally enabled with optional features, you
+will need to enable those features for that code to be analyzed:
+
+ cargo fix --edition --features foo
+
+Similarly, other `cfg` expressions like platform-specific code will need to
+pass `--target` to fix code for the given target.
+
+ cargo fix --edition --target x86_64-pc-windows-gnu
+
+If you encounter any problems with `cargo fix` or otherwise have any questions
+or feature requests please don't hesitate to file an issue at
+
+
+## OPTIONS
+
+### Fix options
+
+{{#options}}
+
+{{#option "`--broken-code`" }}
+Fix code even if it already has compiler errors. This is useful if `cargo fix`
+fails to apply the changes. It will apply the changes and leave the broken
+code in the working directory for you to inspect and manually fix.
+{{/option}}
+
+{{#option "`--edition`" }}
+Apply changes that will update the code to the latest edition. This will not
+update the edition in the `Cargo.toml` manifest, which must be updated
+manually.
+{{/option}}
+
+{{#option "`--edition-idioms`" }}
+Apply suggestions that will update code to the preferred style for the current
+edition.
+{{/option}}
+
+{{#option "`--allow-no-vcs`" }}
+Fix code even if a VCS was not detected.
+{{/option}}
+
+{{#option "`--allow-dirty`" }}
+Fix code even if the working directory has changes.
+{{/option}}
+
+{{#option "`--allow-staged`" }}
+Fix code even if the working directory has staged changes.
+{{/option}}
+
+{{/options}}
+
+{{> section-package-selection }}
+
+### Target Selection
+
+When no target selection options are given, `cargo fix` will fix all targets
+(`--all-targets` implied). Binaries are skipped if they have
+`required-features` that are missing.
+
+{{> options-targets }}
+
+{{> section-features }}
+
+### Compilation Options
+
+{{#options}}
+
+{{> options-target-triple }}
+
+{{> options-release }}
+
+{{> options-profile }}
+
+{{/options}}
+
+### Output Options
+
+{{#options}}
+{{> options-target-dir }}
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+
+{{> options-message-format }}
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+{{> options-manifest-path }}
+
+{{> options-locked }}
+{{/options}}
+
+{{> section-options-common }}
+
+### Miscellaneous Options
+
+{{#options}}
+{{> options-jobs }}
+{{/options}}
+
+{{> section-profiles }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Apply compiler suggestions to the local package:
+
+ cargo fix
+
+2. Convert a 2015 edition to 2018:
+
+ cargo fix --edition
+
+3. Apply suggested idioms for the current edition:
+
+ cargo fix --edition-idioms
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-check" 1}}
diff --git a/src/doc/man/cargo-generate-lockfile.adoc b/src/doc/man/cargo-generate-lockfile.adoc
deleted file mode 100644
index 2b89159782d..00000000000
--- a/src/doc/man/cargo-generate-lockfile.adoc
+++ /dev/null
@@ -1,49 +0,0 @@
-= cargo-generate-lockfile(1)
-:idprefix: cargo_generate-lockfile_
-:doctype: manpage
-
-== NAME
-
-cargo-generate-lockfile - Generate the lockfile for a package
-
-== SYNOPSIS
-
-`cargo generate-lockfile [_OPTIONS_]`
-
-== DESCRIPTION
-
-This command will create the `Cargo.lock` lockfile for the current package or
-workspace. If the lockfile already exists, it will be rebuilt if there are any
-manifest changes or dependency updates.
-
-See also man:cargo-update[1] which is also capable of creating a `Cargo.lock`
-lockfile and has more options for controlling update behavior.
-
-== OPTIONS
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Create or update the lockfile for the current package or workspace:
-
- cargo generate-lockfile
-
-== SEE ALSO
-man:cargo[1], man:cargo-update[1]
diff --git a/src/doc/man/cargo-generate-lockfile.md b/src/doc/man/cargo-generate-lockfile.md
new file mode 100644
index 00000000000..2bc1828e488
--- /dev/null
+++ b/src/doc/man/cargo-generate-lockfile.md
@@ -0,0 +1,49 @@
+# cargo-generate-lockfile(1)
+
+## NAME
+
+cargo-generate-lockfile - Generate the lockfile for a package
+
+## SYNOPSIS
+
+`cargo generate-lockfile` [_options_]
+
+## DESCRIPTION
+
+This command will create the `Cargo.lock` lockfile for the current package or
+workspace. If the lockfile already exists, it will be rebuilt if there are any
+manifest changes or dependency updates.
+
+See also {{man "cargo-update" 1}} which is also capable of creating a `Cargo.lock`
+lockfile and has more options for controlling update behavior.
+
+## OPTIONS
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+{{> options-manifest-path }}
+
+{{> options-locked }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Create or update the lockfile for the current package or workspace:
+
+ cargo generate-lockfile
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-update" 1}}
diff --git a/src/doc/man/cargo-help.adoc b/src/doc/man/cargo-help.adoc
deleted file mode 100644
index bcbb5ba34c3..00000000000
--- a/src/doc/man/cargo-help.adoc
+++ /dev/null
@@ -1,28 +0,0 @@
-= cargo-help(1)
-:idprefix: cargo_help_
-:doctype: manpage
-
-== NAME
-
-cargo-help - Get help for a Cargo command
-
-== SYNOPSIS
-
-`cargo help [_SUBCOMMAND_]`
-
-== DESCRIPTION
-
-Prints a help message for the given command.
-
-== EXAMPLES
-
-. Get help for a command:
-
- cargo help build
-
-. Help is also available with the `--help` flag:
-
- cargo build --help
-
-== SEE ALSO
-man:cargo[1]
diff --git a/src/doc/man/cargo-help.md b/src/doc/man/cargo-help.md
new file mode 100644
index 00000000000..edd8bc0cb1a
--- /dev/null
+++ b/src/doc/man/cargo-help.md
@@ -0,0 +1,26 @@
+# cargo-help(1)
+
+## NAME
+
+cargo-help - Get help for a Cargo command
+
+## SYNOPSIS
+
+`cargo help` [_subcommand_]
+
+## DESCRIPTION
+
+Prints a help message for the given command.
+
+## EXAMPLES
+
+1. Get help for a command:
+
+ cargo help build
+
+2. Help is also available with the `--help` flag:
+
+ cargo build --help
+
+## SEE ALSO
+{{man "cargo" 1}}
diff --git a/src/doc/man/cargo-init.adoc b/src/doc/man/cargo-init.adoc
deleted file mode 100644
index 6df38bf6836..00000000000
--- a/src/doc/man/cargo-init.adoc
+++ /dev/null
@@ -1,55 +0,0 @@
-= cargo-init(1)
-:idprefix: cargo_init_
-:doctype: manpage
-
-== NAME
-
-cargo-init - Create a new Cargo package in an existing directory
-
-== SYNOPSIS
-
-`cargo init [_OPTIONS_] [_PATH_]`
-
-== DESCRIPTION
-
-This command will create a new Cargo manifest in the current directory. Give a
-path as an argument to create in the given directory.
-
-If there are typically-named Rust source files already in the directory, those
-will be used. If not, then a sample `src/main.rs` file will be created, or
-`src/lib.rs` if `--lib` is passed.
-
-If the directory is not already in a VCS repository, then a new repository
-is created (see `--vcs` below).
-
-include::description-new-authors.adoc[]
-
-See man:cargo-new[1] for a similar command which will create a new package in
-a new directory.
-
-== OPTIONS
-
-=== Init Options
-
-include::options-new.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Create a binary Cargo package in the current directory:
-
- cargo init
-
-== SEE ALSO
-man:cargo[1], man:cargo-new[1]
diff --git a/src/doc/man/cargo-init.md b/src/doc/man/cargo-init.md
new file mode 100644
index 00000000000..74e916fab82
--- /dev/null
+++ b/src/doc/man/cargo-init.md
@@ -0,0 +1,53 @@
+# cargo-init(1)
+
+## NAME
+
+cargo-init - Create a new Cargo package in an existing directory
+
+## SYNOPSIS
+
+`cargo init` [_options_] [_path_]
+
+## DESCRIPTION
+
+This command will create a new Cargo manifest in the current directory. Give a
+path as an argument to create in the given directory.
+
+If there are typically-named Rust source files already in the directory, those
+will be used. If not, then a sample `src/main.rs` file will be created, or
+`src/lib.rs` if `--lib` is passed.
+
+If the directory is not already in a VCS repository, then a new repository
+is created (see `--vcs` below).
+
+{{> description-new-authors }}
+
+See {{man "cargo-new" 1}} for a similar command which will create a new package in
+a new directory.
+
+## OPTIONS
+
+### Init Options
+
+{{> options-new }}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Create a binary Cargo package in the current directory:
+
+ cargo init
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-new" 1}}
diff --git a/src/doc/man/cargo-install.adoc b/src/doc/man/cargo-install.adoc
deleted file mode 100644
index 6c96fdcf91f..00000000000
--- a/src/doc/man/cargo-install.adoc
+++ /dev/null
@@ -1,186 +0,0 @@
-= cargo-install(1)
-:idprefix: cargo_install_
-:doctype: manpage
-:actionverb: Install
-
-== NAME
-
-cargo-install - Build and install a Rust binary
-
-== SYNOPSIS
-
-[%hardbreaks]
-`cargo install [_OPTIONS_] _CRATE_...`
-`cargo install [_OPTIONS_] --path _PATH_`
-`cargo install [_OPTIONS_] --git _URL_ [_CRATE_...]`
-`cargo install [_OPTIONS_] --list`
-
-== DESCRIPTION
-
-This command manages Cargo's local set of installed binary crates. Only
-packages which have executable `\[[bin]]` or `\[[example]]` targets can be
-installed, and all executables are installed into the installation root's
-`bin` folder.
-
-include::description-install-root.adoc[]
-
-There are multiple sources from which a crate can be installed. The default
-location is crates.io but the `--git`, `--path`, and `--registry` flags can
-change this source. If the source contains more than one package (such as
-crates.io or a git repository with multiple crates) the _CRATE_ argument is
-required to indicate which crate should be installed.
-
-Crates from crates.io can optionally specify the version they wish to install
-via the `--version` flags, and similarly packages from git repositories can
-optionally specify the branch, tag, or revision that should be installed. If a
-crate has multiple binaries, the `--bin` argument can selectively install only
-one of them, and if you'd rather install examples the `--example` argument can
-be used as well.
-
-If the package is already installed, Cargo will reinstall it if the installed
-version does not appear to be up-to-date. If any of the following values
-change, then Cargo will reinstall the package:
-
-- The package version and source.
-- The set of binary names installed.
-- The chosen features.
-- The release mode (`--debug`).
-- The target (`--target`).
-
-Installing with `--path` will always build and install, unless there are
-conflicting binaries from another package. The `--force` flag may be used to
-force Cargo to always reinstall the package.
-
-If the source is crates.io or `--git` then by default the crate will be built
-in a temporary target directory. To avoid this, the target directory can be
-specified by setting the `CARGO_TARGET_DIR` environment variable to a relative
-path. In particular, this can be useful for caching build artifacts on
-continuous integration systems.
-
-By default, the `Cargo.lock` file that is included with the package will be
-ignored. This means that Cargo will recompute which versions of dependencies
-to use, possibly using newer versions that have been released since the
-package was published. The `--locked` flag can be used to force Cargo to use
-the packaged `Cargo.lock` file if it is available. This may be useful for
-ensuring reproducible builds, to use the exact same set of dependencies that
-were available when the package was published. It may also be useful if a
-newer version of a dependency is published that no longer builds on your
-system, or has other problems. The downside to using `--locked` is that you
-will not receive any fixes or updates to any dependency. Note that Cargo did
-not start publishing `Cargo.lock` files until version 1.37, which means
-packages published with prior versions will not have a `Cargo.lock` file
-available.
-
-== OPTIONS
-
-=== Install Options
-
-*--vers* _VERSION_::
-*--version* _VERSION_::
- Specify a version to install. This may be a
- linkcargo:reference/specifying-dependencies.md[version requirement], like
- `~1.2`, to have Cargo select the newest version from the given
- requirement. If the version does not have a requirement operator (such as
- `^` or `~`), then it must be in the form _MAJOR.MINOR.PATCH_, and will
- install exactly that version; it is *not* treated as a caret requirement
- like Cargo dependencies are.
-
-*--git* _URL_::
- Git URL to install the specified crate from.
-
-*--branch* _BRANCH_::
- Branch to use when installing from git.
-
-*--tag* _TAG_::
- Tag to use when installing from git.
-
-*--rev* _SHA_::
- Specific commit to use when installing from git.
-
-*--path* _PATH_::
- Filesystem path to local crate to install.
-
-*--list*::
- List all installed packages and their versions.
-
-*-f*::
-*--force*::
- Force overwriting existing crates or binaries. This can be used if a
- package has installed a binary with the same name as another package. This
- is also useful if something has changed on the system that you want to
- rebuild with, such as a newer version of `rustc`.
-
-*--no-track*::
- By default, Cargo keeps track of the installed packages with a metadata
- file stored in the installation root directory. This flag tells Cargo not
- to use or create that file. With this flag, Cargo will refuse to overwrite
- any existing files unless the `--force` flag is used. This also disables
- Cargo's ability to protect against multiple concurrent invocations of
- Cargo installing at the same time.
-
-*--bin* _NAME_...::
- Install only the specified binary.
-
-*--bins*::
- Install all binaries.
-
-*--example* _NAME_...::
- Install only the specified example.
-
-*--examples*::
- Install all examples.
-
-*--root* _DIR_::
- Directory to install packages into.
-
-include::options-registry.adoc[]
-
-include::options-index.adoc[]
-
-include::options-features.adoc[]
-
-=== Compilation Options
-
-include::options-target-triple.adoc[]
-
-include::options-target-dir.adoc[]
-
-*--debug*::
- Build with the `dev` profile instead the `release` profile.
-
-=== Manifest Options
-
-include::options-locked.adoc[]
-
-=== Miscellaneous Options
-
-include::options-jobs.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Install or upgrade a package from crates.io:
-
- cargo install ripgrep
-
-. Install or reinstall the package in the current directory:
-
- cargo install --path .
-
-. View the list of installed packages:
-
- cargo install --list
-
-== SEE ALSO
-man:cargo[1], man:cargo-uninstall[1], man:cargo-search[1], man:cargo-publish[1]
diff --git a/src/doc/man/cargo-install.md b/src/doc/man/cargo-install.md
new file mode 100644
index 00000000000..3e1bc02fe94
--- /dev/null
+++ b/src/doc/man/cargo-install.md
@@ -0,0 +1,207 @@
+# cargo-install(1)
+{{*set actionverb="Install"}}
+
+## NAME
+
+cargo-install - Build and install a Rust binary
+
+## SYNOPSIS
+
+`cargo install` [_options_] _crate_...\
+`cargo install` [_options_] `--path` _path_\
+`cargo install` [_options_] `--git` _url_ [_crate_...]\
+`cargo install` [_options_] `--list`
+
+## DESCRIPTION
+
+This command manages Cargo's local set of installed binary crates. Only
+packages which have executable `[[bin]]` or `[[example]]` targets can be
+installed, and all executables are installed into the installation root's
+`bin` folder.
+
+{{> description-install-root }}
+
+There are multiple sources from which a crate can be installed. The default
+location is crates.io but the `--git`, `--path`, and `--registry` flags can
+change this source. If the source contains more than one package (such as
+crates.io or a git repository with multiple crates) the _crate_ argument is
+required to indicate which crate should be installed.
+
+Crates from crates.io can optionally specify the version they wish to install
+via the `--version` flags, and similarly packages from git repositories can
+optionally specify the branch, tag, or revision that should be installed. If a
+crate has multiple binaries, the `--bin` argument can selectively install only
+one of them, and if you'd rather install examples the `--example` argument can
+be used as well.
+
+If the package is already installed, Cargo will reinstall it if the installed
+version does not appear to be up-to-date. If any of the following values
+change, then Cargo will reinstall the package:
+
+- The package version and source.
+- The set of binary names installed.
+- The chosen features.
+- The release mode (`--debug`).
+- The target (`--target`).
+
+Installing with `--path` will always build and install, unless there are
+conflicting binaries from another package. The `--force` flag may be used to
+force Cargo to always reinstall the package.
+
+If the source is crates.io or `--git` then by default the crate will be built
+in a temporary target directory. To avoid this, the target directory can be
+specified by setting the `CARGO_TARGET_DIR` environment variable to a relative
+path. In particular, this can be useful for caching build artifacts on
+continuous integration systems.
+
+By default, the `Cargo.lock` file that is included with the package will be
+ignored. This means that Cargo will recompute which versions of dependencies
+to use, possibly using newer versions that have been released since the
+package was published. The `--locked` flag can be used to force Cargo to use
+the packaged `Cargo.lock` file if it is available. This may be useful for
+ensuring reproducible builds, to use the exact same set of dependencies that
+were available when the package was published. It may also be useful if a
+newer version of a dependency is published that no longer builds on your
+system, or has other problems. The downside to using `--locked` is that you
+will not receive any fixes or updates to any dependency. Note that Cargo did
+not start publishing `Cargo.lock` files until version 1.37, which means
+packages published with prior versions will not have a `Cargo.lock` file
+available.
+
+## OPTIONS
+
+### Install Options
+
+{{#options}}
+
+{{#option "`--vers` _version_" "`--version` _version_" }}
+Specify a version to install. This may be a [version
+requirement](../reference/specifying-dependencies.md), like `~1.2`, to have Cargo
+select the newest version from the given requirement. If the version does not
+have a requirement operator (such as `^` or `~`), then it must be in the form
+_MAJOR.MINOR.PATCH_, and will install exactly that version; it is *not*
+treated as a caret requirement like Cargo dependencies are.
+{{/option}}
+
+{{#option "`--git` _url_" }}
+Git URL to install the specified crate from.
+{{/option}}
+
+{{#option "`--branch` _branch_" }}
+Branch to use when installing from git.
+{{/option}}
+
+{{#option "`--tag` _tag_" }}
+Tag to use when installing from git.
+{{/option}}
+
+{{#option "`--rev` _sha_" }}
+Specific commit to use when installing from git.
+{{/option}}
+
+{{#option "`--path` _path_" }}
+Filesystem path to local crate to install.
+{{/option}}
+
+{{#option "`--list`" }}
+List all installed packages and their versions.
+{{/option}}
+
+{{#option "`-f`" "`--force`" }}
+Force overwriting existing crates or binaries. This can be used if a package
+has installed a binary with the same name as another package. This is also
+useful if something has changed on the system that you want to rebuild with,
+such as a newer version of `rustc`.
+{{/option}}
+
+{{#option "`--no-track`" }}
+By default, Cargo keeps track of the installed packages with a metadata file
+stored in the installation root directory. This flag tells Cargo not to use or
+create that file. With this flag, Cargo will refuse to overwrite any existing
+files unless the `--force` flag is used. This also disables Cargo's ability to
+protect against multiple concurrent invocations of Cargo installing at the
+same time.
+{{/option}}
+
+{{#option "`--bin` _name_..." }}
+Install only the specified binary.
+{{/option}}
+
+{{#option "`--bins`" }}
+Install all binaries.
+{{/option}}
+
+{{#option "`--example` _name_..." }}
+Install only the specified example.
+{{/option}}
+
+{{#option "`--examples`" }}
+Install all examples.
+{{/option}}
+
+{{#option "`--root` _dir_" }}
+Directory to install packages into.
+{{/option}}
+
+{{> options-registry }}
+
+{{> options-index }}
+
+{{/options}}
+
+{{> section-features }}
+
+### Compilation Options
+
+{{#options}}
+
+{{> options-target-triple }}
+
+{{> options-target-dir }}
+
+{{#option "`--debug`" }}
+Build with the `dev` profile instead the `release` profile.
+{{/option}}
+
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+{{> options-locked }}
+{{/options}}
+
+### Miscellaneous Options
+
+{{#options}}
+{{> options-jobs }}
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Install or upgrade a package from crates.io:
+
+ cargo install ripgrep
+
+2. Install or reinstall the package in the current directory:
+
+ cargo install --path .
+
+3. View the list of installed packages:
+
+ cargo install --list
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-uninstall" 1}}, {{man "cargo-search" 1}}, {{man "cargo-publish" 1}}
diff --git a/src/doc/man/cargo-locate-project.adoc b/src/doc/man/cargo-locate-project.adoc
deleted file mode 100644
index adfc7a39ebf..00000000000
--- a/src/doc/man/cargo-locate-project.adoc
+++ /dev/null
@@ -1,46 +0,0 @@
-= cargo-locate-project(1)
-:idprefix: cargo_locate-project_
-:doctype: manpage
-
-== NAME
-
-cargo-locate-project - Print a JSON representation of a Cargo.toml file's location
-
-== SYNOPSIS
-
-`cargo locate-project [_OPTIONS_]`
-
-== DESCRIPTION
-
-This command will print a JSON object to stdout with the full path to the
-`Cargo.toml` manifest.
-
-See also man:cargo-metadata[1] which is capable of returning the path to a
-workspace root.
-
-== OPTIONS
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Display the path to the manifest based on the current directory:
-
- cargo locate-project
-
-== SEE ALSO
-man:cargo[1], man:cargo-metadata[1]
diff --git a/src/doc/man/cargo-locate-project.md b/src/doc/man/cargo-locate-project.md
new file mode 100644
index 00000000000..349e63c5e8d
--- /dev/null
+++ b/src/doc/man/cargo-locate-project.md
@@ -0,0 +1,46 @@
+# cargo-locate-project(1)
+
+## NAME
+
+cargo-locate-project - Print a JSON representation of a Cargo.toml file's location
+
+## SYNOPSIS
+
+`cargo locate-project` [_options_]
+
+## DESCRIPTION
+
+This command will print a JSON object to stdout with the full path to the
+`Cargo.toml` manifest.
+
+See also {{man "cargo-metadata" 1}} which is capable of returning the path to a
+workspace root.
+
+## OPTIONS
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+{{> options-manifest-path }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Display the path to the manifest based on the current directory:
+
+ cargo locate-project
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-metadata" 1}}
diff --git a/src/doc/man/cargo-login.adoc b/src/doc/man/cargo-login.adoc
deleted file mode 100644
index 2d3a8e7527b..00000000000
--- a/src/doc/man/cargo-login.adoc
+++ /dev/null
@@ -1,51 +0,0 @@
-= cargo-login(1)
-:idprefix: cargo_login_
-:doctype: manpage
-
-== NAME
-
-cargo-login - Save an API token from the registry locally
-
-== SYNOPSIS
-
-`cargo login [_OPTIONS_] [_TOKEN_]`
-
-== DESCRIPTION
-
-This command will save the API token to disk so that commands that require
-authentication, such as man:cargo-publish[1], will be automatically
-authenticated. The token is saved in `$CARGO_HOME/credentials.toml`. `CARGO_HOME`
-defaults to `.cargo` in your home directory.
-
-If the _TOKEN_ argument is not specified, it will be read from stdin.
-
-The API token for crates.io may be retrieved from https://crates.io/me.
-
-Take care to keep the token secret, it should not be shared with anyone else.
-
-== OPTIONS
-
-=== Login Options
-
-include::options-registry.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Save the API token to disk:
-
- cargo login
-
-== SEE ALSO
-man:cargo[1], man:cargo-publish[1]
diff --git a/src/doc/man/cargo-login.md b/src/doc/man/cargo-login.md
new file mode 100644
index 00000000000..0e361ab74a0
--- /dev/null
+++ b/src/doc/man/cargo-login.md
@@ -0,0 +1,51 @@
+# cargo-login(1)
+
+## NAME
+
+cargo-login - Save an API token from the registry locally
+
+## SYNOPSIS
+
+`cargo login` [_options_] [_token_]
+
+## DESCRIPTION
+
+This command will save the API token to disk so that commands that require
+authentication, such as {{man "cargo-publish" 1}}, will be automatically
+authenticated. The token is saved in `$CARGO_HOME/credentials.toml`. `CARGO_HOME`
+defaults to `.cargo` in your home directory.
+
+If the _token_ argument is not specified, it will be read from stdin.
+
+The API token for crates.io may be retrieved from .
+
+Take care to keep the token secret, it should not be shared with anyone else.
+
+## OPTIONS
+
+### Login Options
+
+{{#options}}
+{{> options-registry }}
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Save the API token to disk:
+
+ cargo login
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-publish" 1}}
diff --git a/src/doc/man/cargo-metadata.adoc b/src/doc/man/cargo-metadata.md
similarity index 91%
rename from src/doc/man/cargo-metadata.adoc
rename to src/doc/man/cargo-metadata.md
index 09a865a7ad9..45c8b04f37e 100644
--- a/src/doc/man/cargo-metadata.adoc
+++ b/src/doc/man/cargo-metadata.md
@@ -1,17 +1,15 @@
-= cargo-metadata(1)
-:idprefix: cargo_metadata_
-:doctype: manpage
+# cargo-metadata(1)
:source-highlighter: highlightjs
-== NAME
+## NAME
cargo-metadata - Machine-readable metadata about the current package
-== SYNOPSIS
+## SYNOPSIS
-`cargo metadata [_OPTIONS_]`
+`cargo metadata` [_options_]
-== DESCRIPTION
+## DESCRIPTION
Output JSON to stdout containing information about the workspace members and
resolved dependencies of the current package.
@@ -19,15 +17,14 @@ resolved dependencies of the current package.
It is recommended to include the `--format-version` flag to future-proof
your code to ensure the output is in the format you are expecting.
-See the link:https://crates.io/crates/cargo_metadata[cargo_metadata crate]
+See the [cargo_metadata crate](https://crates.io/crates/cargo_metadata)
for a Rust API for reading the metadata.
-== OUTPUT FORMAT
+## OUTPUT FORMAT
The output has the following format:
-[source,javascript]
-----
+```javascript
{
/* Array of all packages in the workspace.
It also includes all feature-enabled dependencies unless --no-deps is used.
@@ -281,53 +278,62 @@ The output has the following format:
}
}
}
-----
+````
-== OPTIONS
+## OPTIONS
-=== Output Options
+### Output Options
-*--no-deps*::
- Output information only about the workspace members and don't fetch
- dependencies.
+{{#options}}
-*--format-version* _VERSION_::
- Specify the version of the output format to use. Currently `1` is the only
- possible value.
+{{#option "`--no-deps`" }}
+Output information only about the workspace members and don't fetch
+dependencies.
+{{/option}}
+
+{{#option "`--format-version` _version_" }}
+Specify the version of the output format to use. Currently `1` is the only
+possible value.
+{{/option}}
+
+{{#option "`--filter-platform` _triple_" }}
+This filters the `resolve` output to only include dependencies for the
+given target triple. Without this flag, the resolve includes all targets.
-*--filter-platform* _TRIPLE_::
- This filters the `resolve` output to only include dependencies for the
- given target triple. Without this flag, the resolve includes all targets.
-+
Note that the dependencies listed in the "packages" array still includes all
dependencies. Each package definition is intended to be an unaltered
reproduction of the information within `Cargo.toml`.
+{{/option}}
-include::options-features.adoc[]
+{{/options}}
-=== Display Options
+{{> section-features }}
-include::options-display.adoc[]
+### Display Options
-=== Manifest Options
+{{#options}}
+{{> options-display }}
+{{/options}}
-include::options-manifest-path.adoc[]
+### Manifest Options
-include::options-locked.adoc[]
+{{#options}}
+{{> options-manifest-path }}
-=== Common Options
+{{> options-locked }}
+{{/options}}
-include::options-common.adoc[]
+{{> section-options-common }}
-include::section-environment.adoc[]
+{{> section-environment }}
-include::section-exit-status.adoc[]
+{{> section-exit-status }}
-== EXAMPLES
+## EXAMPLES
-. Output JSON about the current package:
+1. Output JSON about the current package:
- cargo metadata --format-version=1
+ cargo metadata --format-version=1
-== SEE ALSO
-man:cargo[1]
+## SEE ALSO
+{{man "cargo" 1}}
diff --git a/src/doc/man/cargo-new.adoc b/src/doc/man/cargo-new.adoc
deleted file mode 100644
index 6587a378960..00000000000
--- a/src/doc/man/cargo-new.adoc
+++ /dev/null
@@ -1,50 +0,0 @@
-= cargo-new(1)
-:idprefix: cargo_new_
-:doctype: manpage
-
-== NAME
-
-cargo-new - Create a new Cargo package
-
-== SYNOPSIS
-
-`cargo new [_OPTIONS_] _PATH_`
-
-== DESCRIPTION
-
-This command will create a new Cargo package in the given directory. This
-includes a simple template with a `Cargo.toml` manifest, sample source file,
-and a VCS ignore file. If the directory is not already in a VCS repository,
-then a new repository is created (see `--vcs` below).
-
-include::description-new-authors.adoc[]
-
-See man:cargo-init[1] for a similar command which will create a new manifest
-in an existing directory.
-
-== OPTIONS
-
-=== New Options
-
-include::options-new.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Create a binary Cargo package in the given directory:
-
- cargo new foo
-
-== SEE ALSO
-man:cargo[1], man:cargo-init[1]
diff --git a/src/doc/man/cargo-new.md b/src/doc/man/cargo-new.md
new file mode 100644
index 00000000000..a8b039fc26b
--- /dev/null
+++ b/src/doc/man/cargo-new.md
@@ -0,0 +1,48 @@
+# cargo-new(1)
+
+## NAME
+
+cargo-new - Create a new Cargo package
+
+## SYNOPSIS
+
+`cargo new` [_options_] _path_
+
+## DESCRIPTION
+
+This command will create a new Cargo package in the given directory. This
+includes a simple template with a `Cargo.toml` manifest, sample source file,
+and a VCS ignore file. If the directory is not already in a VCS repository,
+then a new repository is created (see `--vcs` below).
+
+{{> description-new-authors }}
+
+See {{man "cargo-init" 1}} for a similar command which will create a new manifest
+in an existing directory.
+
+## OPTIONS
+
+### New Options
+
+{{> options-new }}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Create a binary Cargo package in the given directory:
+
+ cargo new foo
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-init" 1}}
diff --git a/src/doc/man/cargo-owner.adoc b/src/doc/man/cargo-owner.adoc
deleted file mode 100644
index 63e6e309d1b..00000000000
--- a/src/doc/man/cargo-owner.adoc
+++ /dev/null
@@ -1,80 +0,0 @@
-= cargo-owner(1)
-:idprefix: cargo_owner_
-:doctype: manpage
-
-== NAME
-
-cargo-owner - Manage the owners of a crate on the registry
-
-== SYNOPSIS
-
-[%hardbreaks]
-`cargo owner [_OPTIONS_] --add _LOGIN_ [_CRATE_]`
-`cargo owner [_OPTIONS_] --remove _LOGIN_ [_CRATE_]`
-`cargo owner [_OPTIONS_] --list [_CRATE_]`
-
-== DESCRIPTION
-
-This command will modify the owners for a crate on the registry. Owners of a
-crate can upload new versions and yank old versions. Non-team owners can also
-modify the set of owners, so take care!
-
-This command requires you to be authenticated with either the `--token` option
-or using man:cargo-login[1].
-
-If the crate name is not specified, it will use the package name from the
-current directory.
-
-See linkcargo:reference/publishing.html#cargo-owner[the reference] for more
-information about owners and publishing.
-
-== OPTIONS
-
-=== Owner Options
-
-*-a*::
-*--add* _LOGIN_...::
- Invite the given user or team as an owner.
-
-*-r*::
-*--remove* _LOGIN_...::
- Remove the given user or team as an owner.
-
-*-l*::
-*--list*::
- List owners of a crate.
-
-include::options-token.adoc[]
-
-include::options-index.adoc[]
-
-include::options-registry.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. List owners of a package:
-
- cargo owner --list foo
-
-. Invite an owner to a package:
-
- cargo owner --add username foo
-
-. Remove an owner from a package:
-
- cargo owner --remove username foo
-
-== SEE ALSO
-man:cargo[1], man:cargo-login[1], man:cargo-publish[1]
diff --git a/src/doc/man/cargo-owner.md b/src/doc/man/cargo-owner.md
new file mode 100644
index 00000000000..3787a4de045
--- /dev/null
+++ b/src/doc/man/cargo-owner.md
@@ -0,0 +1,81 @@
+# cargo-owner(1)
+
+## NAME
+
+cargo-owner - Manage the owners of a crate on the registry
+
+## SYNOPSIS
+
+`cargo owner` [_options_] `--add` _login_ [_crate_]\
+`cargo owner` [_options_] `--remove` _login_ [_crate_]\
+`cargo owner` [_options_] `--list` [_crate_]
+
+## DESCRIPTION
+
+This command will modify the owners for a crate on the registry. Owners of a
+crate can upload new versions and yank old versions. Non-team owners can also
+modify the set of owners, so take care!
+
+This command requires you to be authenticated with either the `--token` option
+or using {{man "cargo-login" 1}}.
+
+If the crate name is not specified, it will use the package name from the
+current directory.
+
+See [the reference](../reference/publishing.html#cargo-owner) for more
+information about owners and publishing.
+
+## OPTIONS
+
+### Owner Options
+
+{{#options}}
+
+{{#option "`-a`" "`--add` _login_..." }}
+Invite the given user or team as an owner.
+{{/option}}
+
+{{#option "`-r`" "`--remove` _login_..." }}
+Remove the given user or team as an owner.
+{{/option}}
+
+{{#option "`-l`" "`--list`" }}
+List owners of a crate.
+{{/option}}
+
+{{> options-token }}
+
+{{> options-index }}
+
+{{> options-registry }}
+
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. List owners of a package:
+
+ cargo owner --list foo
+
+2. Invite an owner to a package:
+
+ cargo owner --add username foo
+
+3. Remove an owner from a package:
+
+ cargo owner --remove username foo
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-login" 1}}, {{man "cargo-publish" 1}}
diff --git a/src/doc/man/cargo-package.adoc b/src/doc/man/cargo-package.adoc
deleted file mode 100644
index ba1c1b5d69a..00000000000
--- a/src/doc/man/cargo-package.adoc
+++ /dev/null
@@ -1,102 +0,0 @@
-= cargo-package(1)
-:idprefix: cargo_package_
-:doctype: manpage
-:actionverb: Package
-
-== NAME
-
-cargo-package - Assemble the local package into a distributable tarball
-
-== SYNOPSIS
-
-`cargo package [_OPTIONS_]`
-
-== DESCRIPTION
-
-This command will create a distributable, compressed `.crate` file with the
-source code of the package in the current directory. The resulting file will
-be stored in the `target/package` directory. This performs the following
-steps:
-
-. Load and check the current workspace, performing some basic checks.
- - Path dependencies are not allowed unless they have a version key. Cargo
- will ignore the path key for dependencies in published packages.
- `dev-dependencies` do not have this restriction.
-. Create the compressed `.crate` file.
- - The original `Cargo.toml` file is rewritten and normalized.
- - `[patch]`, `[replace]`, and `[workspace]` sections are removed from the
- manifest.
- - `Cargo.lock` is automatically included if the package contains an
- executable binary or example target. man:cargo-install[1] will use the
- packaged lock file if the `--locked` flag is used.
- - A `.cargo_vcs_info.json` file is included that contains information
- about the current VCS checkout hash if available (not included with
- `--allow-dirty`).
-. Extract the `.crate` file and build it to verify it can build.
- - This will rebuild your package from scratch to ensure that it can be
- built from a pristine state. The `--no-verify` flag can be used to skip
- this step.
-. Check that build scripts did not modify any source files.
-
-The list of files included can be controlled with the `include` and `exclude`
-fields in the manifest.
-
-See linkcargo:reference/publishing.html[the reference] for more details about
-packaging and publishing.
-
-== OPTIONS
-
-=== Package Options
-
-*-l*::
-*--list*::
- Print files included in a package without making one.
-
-*--no-verify*::
- Don't verify the contents by building them.
-
-*--no-metadata*::
- Ignore warnings about a lack of human-usable metadata (such as the
- description or the license).
-
-*--allow-dirty*::
- Allow working directories with uncommitted VCS changes to be packaged.
-
-=== Compilation Options
-
-include::options-target-triple.adoc[]
-
-include::options-target-dir.adoc[]
-
-include::options-features.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Miscellaneous Options
-
-include::options-jobs.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Create a compressed `.crate` file of the current package:
-
- cargo package
-
-== SEE ALSO
-man:cargo[1], man:cargo-publish[1]
diff --git a/src/doc/man/cargo-package.md b/src/doc/man/cargo-package.md
new file mode 100644
index 00000000000..a825299b0cf
--- /dev/null
+++ b/src/doc/man/cargo-package.md
@@ -0,0 +1,117 @@
+# cargo-package(1)
+{{*set actionverb="Package"}}
+
+## NAME
+
+cargo-package - Assemble the local package into a distributable tarball
+
+## SYNOPSIS
+
+`cargo package` [_options_]
+
+## DESCRIPTION
+
+This command will create a distributable, compressed `.crate` file with the
+source code of the package in the current directory. The resulting file will
+be stored in the `target/package` directory. This performs the following
+steps:
+
+1. Load and check the current workspace, performing some basic checks.
+ - Path dependencies are not allowed unless they have a version key. Cargo
+ will ignore the path key for dependencies in published packages.
+ `dev-dependencies` do not have this restriction.
+2. Create the compressed `.crate` file.
+ - The original `Cargo.toml` file is rewritten and normalized.
+ - `[patch]`, `[replace]`, and `[workspace]` sections are removed from the
+ manifest.
+ - `Cargo.lock` is automatically included if the package contains an
+ executable binary or example target. {{man "cargo-install" 1}} will use the
+ packaged lock file if the `--locked` flag is used.
+ - A `.cargo_vcs_info.json` file is included that contains information
+ about the current VCS checkout hash if available (not included with
+ `--allow-dirty`).
+3. Extract the `.crate` file and build it to verify it can build.
+ - This will rebuild your package from scratch to ensure that it can be
+ built from a pristine state. The `--no-verify` flag can be used to skip
+ this step.
+4. Check that build scripts did not modify any source files.
+
+The list of files included can be controlled with the `include` and `exclude`
+fields in the manifest.
+
+See [the reference](../reference/publishing.html) for more details about
+packaging and publishing.
+
+## OPTIONS
+
+### Package Options
+
+{{#options}}
+
+{{#option "`-l`" "`--list`" }}
+Print files included in a package without making one.
+{{/option}}
+
+{{#option "`--no-verify`" }}
+Don't verify the contents by building them.
+{{/option}}
+
+{{#option "`--no-metadata`" }}
+Ignore warnings about a lack of human-usable metadata (such as the description
+or the license).
+{{/option}}
+
+{{#option "`--allow-dirty`" }}
+Allow working directories with uncommitted VCS changes to be packaged.
+{{/option}}
+
+{{/options}}
+
+### Compilation Options
+
+{{#options}}
+
+{{> options-target-triple }}
+
+{{> options-target-dir }}
+
+{{/options}}
+
+{{> section-features }}
+
+### Manifest Options
+
+{{#options}}
+
+{{> options-manifest-path }}
+
+{{> options-locked }}
+
+{{/options}}
+
+### Miscellaneous Options
+
+{{#options}}
+{{> options-jobs }}
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Create a compressed `.crate` file of the current package:
+
+ cargo package
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-publish" 1}}
diff --git a/src/doc/man/cargo-pkgid.adoc b/src/doc/man/cargo-pkgid.adoc
deleted file mode 100644
index 98ff9dd9d89..00000000000
--- a/src/doc/man/cargo-pkgid.adoc
+++ /dev/null
@@ -1,94 +0,0 @@
-= cargo-pkgid(1)
-:idprefix: cargo_pkgid_
-:doctype: manpage
-
-== NAME
-
-cargo-pkgid - Print a fully qualified package specification
-
-== SYNOPSIS
-
-`cargo pkgid [_OPTIONS_] [_SPEC_]`
-
-== DESCRIPTION
-
-Given a _SPEC_ argument, print out the fully qualified package ID specifier
-for a package or dependency in the current workspace. This command will
-generate an error if _SPEC_ is ambiguous as to which package it refers to in
-the dependency graph. If no _SPEC_ is given, then the specifier for the local
-package is printed.
-
-This command requires that a lockfile is available and dependencies have been
-fetched.
-
-A package specifier consists of a name, version, and source URL. You are
-allowed to use partial specifiers to succinctly match a specific package as
-long as it matches only one package. The format of a _SPEC_ can be one of the
-following:
-
-[%autowidth]
-.SPEC Query Format
-|===
-|SPEC Structure |Example SPEC
-
-|__NAME__
-|`bitflags`
-
-|__NAME__``:``__VERSION__
-|`bitflags:1.0.4`
-
-|__URL__
-|`https://github.com/rust-lang/cargo`
-
-|__URL__``#``__VERSION__
-|`https://github.com/rust-lang/cargo#0.33.0`
-
-|__URL__``#``__NAME__
-|`https://github.com/rust-lang/crates.io-index#bitflags`
-
-|__URL__``#``__NAME__``:``__VERSION__
-|`https://github.com/rust-lang/cargo#crates-io:0.21.0`
-|===
-
-== OPTIONS
-
-=== Package Selection
-
-*-p* _SPEC_::
-*--package* _SPEC_::
- Get the package ID for the given package instead of the current package.
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Retrieve package specification for `foo` package:
-
- cargo pkgid foo
-
-. Retrieve package specification for version 1.0.0 of `foo`:
-
- cargo pkgid foo:1.0.0
-
-. Retrieve package specification for `foo` from crates.io:
-
- cargo pkgid https://github.com/rust-lang/crates.io-index#foo
-
-== SEE ALSO
-man:cargo[1], man:cargo-generate-lockfile[1], man:cargo-metadata[1]
diff --git a/src/doc/man/cargo-pkgid.md b/src/doc/man/cargo-pkgid.md
new file mode 100644
index 00000000000..12f8cacc8c4
--- /dev/null
+++ b/src/doc/man/cargo-pkgid.md
@@ -0,0 +1,85 @@
+# cargo-pkgid(1)
+
+## NAME
+
+cargo-pkgid - Print a fully qualified package specification
+
+## SYNOPSIS
+
+`cargo pkgid` [_options_] [_spec_]
+
+## DESCRIPTION
+
+Given a _spec_ argument, print out the fully qualified package ID specifier
+for a package or dependency in the current workspace. This command will
+generate an error if _spec_ is ambiguous as to which package it refers to in
+the dependency graph. If no _spec_ is given, then the specifier for the local
+package is printed.
+
+This command requires that a lockfile is available and dependencies have been
+fetched.
+
+A package specifier consists of a name, version, and source URL. You are
+allowed to use partial specifiers to succinctly match a specific package as
+long as it matches only one package. The format of a _spec_ can be one of the
+following:
+
+SPEC Structure | Example SPEC
+---------------------------|--------------
+_name_ | `bitflags`
+_name_`:`_version_ | `bitflags:1.0.4`
+_url_ | `https://github.com/rust-lang/cargo`
+_url_`#`_version_ | `https://github.com/rust-lang/cargo#0.33.0`
+_url_`#`_name_ | `https://github.com/rust-lang/crates.io-index#bitflags`
+_url_`#`_name_`:`_version_ | `https://github.com/rust-lang/cargo#crates-io:0.21.0`
+
+## OPTIONS
+
+### Package Selection
+
+{{#options}}
+
+{{#option "`-p` _spec_" "`--package` _spec_" }}
+Get the package ID for the given package instead of the current package.
+{{/option}}
+
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+
+{{> options-manifest-path }}
+
+{{> options-locked }}
+
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Retrieve package specification for `foo` package:
+
+ cargo pkgid foo
+
+2. Retrieve package specification for version 1.0.0 of `foo`:
+
+ cargo pkgid foo:1.0.0
+
+3. Retrieve package specification for `foo` from crates.io:
+
+ cargo pkgid https://github.com/rust-lang/crates.io-index#foo
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-generate-lockfile" 1}}, {{man "cargo-metadata" 1}}
diff --git a/src/doc/man/cargo-publish.adoc b/src/doc/man/cargo-publish.adoc
deleted file mode 100644
index f63c38ba628..00000000000
--- a/src/doc/man/cargo-publish.adoc
+++ /dev/null
@@ -1,90 +0,0 @@
-= cargo-publish(1)
-:idprefix: cargo_publish_
-:doctype: manpage
-:actionverb: Publish
-
-== NAME
-
-cargo-publish - Upload a package to the registry
-
-== SYNOPSIS
-
-`cargo publish [_OPTIONS_]`
-
-== DESCRIPTION
-
-This command will create a distributable, compressed `.crate` file with the
-source code of the package in the current directory and upload it to a
-registry. The default registry is https://crates.io. This performs the
-following steps:
-
-. Performs a few checks, including:
- - Checks the `package.publish` key in the manifest for restrictions on which
- registries you are allowed to publish to.
-. Create a `.crate` file by following the steps in man:cargo-package[1].
-. Upload the crate to the registry. Note that the server will perform
- additional checks on the crate.
-
-This command requires you to be authenticated with either the `--token` option
-or using man:cargo-login[1].
-
-See linkcargo:reference/publishing.html[the reference] for more details about
-packaging and publishing.
-
-== OPTIONS
-
-=== Publish Options
-
-*--dry-run*::
- Perform all checks without uploading.
-
-include::options-token.adoc[]
-
-*--no-verify*::
- Don't verify the contents by building them.
-
-*--allow-dirty*::
- Allow working directories with uncommitted VCS changes to be packaged.
-
-include::options-index.adoc[]
-
-include::options-registry.adoc[]
-
-=== Compilation Options
-
-include::options-target-triple.adoc[]
-
-include::options-target-dir.adoc[]
-
-include::options-features.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Miscellaneous Options
-
-include::options-jobs.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Publish the current package:
-
- cargo publish
-
-== SEE ALSO
-man:cargo[1], man:cargo-package[1], man:cargo-login[1]
diff --git a/src/doc/man/cargo-publish.md b/src/doc/man/cargo-publish.md
new file mode 100644
index 00000000000..8267a8d4888
--- /dev/null
+++ b/src/doc/man/cargo-publish.md
@@ -0,0 +1,105 @@
+# cargo-publish(1)
+{{*set actionverb="Publish"}}
+
+## NAME
+
+cargo-publish - Upload a package to the registry
+
+## SYNOPSIS
+
+`cargo publish` [_options_]
+
+## DESCRIPTION
+
+This command will create a distributable, compressed `.crate` file with the
+source code of the package in the current directory and upload it to a
+registry. The default registry is . This performs the
+following steps:
+
+1. Performs a few checks, including:
+ - Checks the `package.publish` key in the manifest for restrictions on
+ which registries you are allowed to publish to.
+2. Create a `.crate` file by following the steps in {{man "cargo-package" 1}}.
+3. Upload the crate to the registry. Note that the server will perform
+ additional checks on the crate.
+
+This command requires you to be authenticated with either the `--token` option
+or using {{man "cargo-login" 1}}.
+
+See [the reference](../reference/publishing.html) for more details about
+packaging and publishing.
+
+## OPTIONS
+
+### Publish Options
+
+{{#options}}
+
+{{#option "`--dry-run`" }}
+Perform all checks without uploading.
+{{/option}}
+
+{{> options-token }}
+
+{{#option "`--no-verify`" }}
+Don't verify the contents by building them.
+{{/option}}
+
+{{#option "`--allow-dirty`" }}
+Allow working directories with uncommitted VCS changes to be packaged.
+{{/option}}
+
+{{> options-index }}
+
+{{> options-registry }}
+
+{{/options}}
+
+### Compilation Options
+
+{{#options}}
+
+{{> options-target-triple }}
+
+{{> options-target-dir }}
+
+{{/options}}
+
+{{> section-features }}
+
+### Manifest Options
+
+{{#options}}
+
+{{> options-manifest-path }}
+
+{{> options-locked }}
+
+{{/options}}
+
+### Miscellaneous Options
+
+{{#options}}
+{{> options-jobs }}
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Publish the current package:
+
+ cargo publish
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-package" 1}}, {{man "cargo-login" 1}}
diff --git a/src/doc/man/cargo-run.adoc b/src/doc/man/cargo-run.adoc
deleted file mode 100644
index 8aa64e75776..00000000000
--- a/src/doc/man/cargo-run.adoc
+++ /dev/null
@@ -1,90 +0,0 @@
-= cargo-run(1)
-:idprefix: cargo_run_
-:doctype: manpage
-:actionverb: Run
-
-== NAME
-
-cargo-run - Run the current package
-
-== SYNOPSIS
-
-`cargo run [_OPTIONS_] [-- _ARGS_]`
-
-== DESCRIPTION
-
-Run a binary or example of the local package.
-
-All the arguments following the two dashes (`--`) are passed to the binary to
-run. If you're passing arguments to both Cargo and the binary, the ones after
-`--` go to the binary, the ones before go to Cargo.
-
-== OPTIONS
-
-=== Package Selection
-
-include::options-package.adoc[]
-
-=== Target Selection
-
-When no target selection options are given, `cargo run` will run the binary
-target. If there are multiple binary targets, you must pass a target flag to
-choose one. Or, the `default-run` field may be specified in the `[package]`
-section of `Cargo.toml` to choose the name of the binary to run by default.
-
-*--bin* _NAME_::
- Run the specified binary.
-
-*--example* _NAME_::
- Run the specified example.
-
-include::options-features.adoc[]
-
-=== Compilation Options
-
-include::options-target-triple.adoc[]
-
-include::options-release.adoc[]
-
-=== Output Options
-
-include::options-target-dir.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-include::options-message-format.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-=== Miscellaneous Options
-
-include::options-jobs.adoc[]
-
-include::section-profiles.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Build the local package and run its main target (assuming only one binary):
-
- cargo run
-
-. Run an example with extra arguments:
-
- cargo run --example exname -- --exoption exarg1 exarg2
-
-== SEE ALSO
-man:cargo[1], man:cargo-build[1]
diff --git a/src/doc/man/cargo-run.md b/src/doc/man/cargo-run.md
new file mode 100644
index 00000000000..bd545613c90
--- /dev/null
+++ b/src/doc/man/cargo-run.md
@@ -0,0 +1,106 @@
+# cargo-run(1)
+{{*set actionverb="Run"}}
+
+## NAME
+
+cargo-run - Run the current package
+
+## SYNOPSIS
+
+`cargo run` [_options_] [`--` _args_]
+
+## DESCRIPTION
+
+Run a binary or example of the local package.
+
+All the arguments following the two dashes (`--`) are passed to the binary to
+run. If you're passing arguments to both Cargo and the binary, the ones after
+`--` go to the binary, the ones before go to Cargo.
+
+## OPTIONS
+
+{{> section-options-package }}
+
+### Target Selection
+
+When no target selection options are given, `cargo run` will run the binary
+target. If there are multiple binary targets, you must pass a target flag to
+choose one. Or, the `default-run` field may be specified in the `[package]`
+section of `Cargo.toml` to choose the name of the binary to run by default.
+
+{{#options}}
+
+{{#option "`--bin` _name_" }}
+Run the specified binary.
+{{/option}}
+
+{{#option "`--example` _name_" }}
+Run the specified example.
+{{/option}}
+
+{{/options}}
+
+{{> section-features }}
+
+### Compilation Options
+
+{{#options}}
+
+{{> options-target-triple }}
+
+{{> options-release }}
+
+{{/options}}
+
+### Output Options
+
+{{#options}}
+{{> options-target-dir }}
+{{/options}}
+
+### Display Options
+
+{{#options}}
+
+{{> options-display }}
+
+{{> options-message-format }}
+
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+
+{{> options-manifest-path }}
+
+{{> options-locked }}
+
+{{/options}}
+
+{{> section-options-common }}
+
+### Miscellaneous Options
+
+{{#options}}
+{{> options-jobs }}
+{{/options}}
+
+{{> section-profiles }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Build the local package and run its main target (assuming only one binary):
+
+ cargo run
+
+2. Run an example with extra arguments:
+
+ cargo run --example exname -- --exoption exarg1 exarg2
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-build" 1}}
diff --git a/src/doc/man/cargo-rustc.adoc b/src/doc/man/cargo-rustc.adoc
deleted file mode 100644
index e3ef3e5fc72..00000000000
--- a/src/doc/man/cargo-rustc.adoc
+++ /dev/null
@@ -1,94 +0,0 @@
-= cargo-rustc(1)
-:idprefix: cargo_rustc_
-:doctype: manpage
-:actionverb: Build
-
-== NAME
-
-cargo-rustc - Compile the current package, and pass extra options to the compiler
-
-== SYNOPSIS
-
-`cargo rustc [_OPTIONS_] [-- _ARGS_]`
-
-== DESCRIPTION
-
-The specified target for the current package (or package specified by `-p` if
-provided) will be compiled along with all of its dependencies. The specified
-_ARGS_ will all be passed to the final compiler invocation, not any of the
-dependencies. Note that the compiler will still unconditionally receive
-arguments such as `-L`, `--extern`, and `--crate-type`, and the specified
-_ARGS_ will simply be added to the compiler invocation.
-
-See https://doc.rust-lang.org/rustc/index.html for documentation on rustc
-flags.
-
-include::description-one-target.adoc[]
-To pass flags to all compiler processes spawned by Cargo, use the `RUSTFLAGS`
-linkcargo:reference/environment-variables.html[environment variable] or the
-`build.rustflags` linkcargo:reference/config.html[config value].
-
-== OPTIONS
-
-=== Package Selection
-
-include::options-package.adoc[]
-
-=== Target Selection
-
-When no target selection options are given, `cargo rustc` will build all
-binary and library targets of the selected package.
-
-include::options-targets.adoc[]
-
-include::options-features.adoc[]
-
-=== Compilation Options
-
-include::options-target-triple.adoc[]
-
-include::options-release.adoc[]
-
-=== Output Options
-
-include::options-target-dir.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-include::options-message-format.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-=== Miscellaneous Options
-
-include::options-jobs.adoc[]
-
-include::section-profiles.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Check if your package (not including dependencies) uses unsafe code:
-
- cargo rustc --lib -- -D unsafe-code
-
-. Try an experimental flag on the nightly compiler, such as this which prints
- the size of every type:
-
- cargo rustc --lib -- -Z print-type-sizes
-
-== SEE ALSO
-man:cargo[1], man:cargo-build[1], man:rustc[1]
diff --git a/src/doc/man/cargo-rustc.md b/src/doc/man/cargo-rustc.md
new file mode 100644
index 00000000000..c7f74573bee
--- /dev/null
+++ b/src/doc/man/cargo-rustc.md
@@ -0,0 +1,104 @@
+# cargo-rustc(1)
+{{*set actionverb="Build"}}
+
+## NAME
+
+cargo-rustc - Compile the current package, and pass extra options to the compiler
+
+## SYNOPSIS
+
+`cargo rustc` [_options_] [`--` _args_]
+
+## DESCRIPTION
+
+The specified target for the current package (or package specified by `-p` if
+provided) will be compiled along with all of its dependencies. The specified
+_args_ will all be passed to the final compiler invocation, not any of the
+dependencies. Note that the compiler will still unconditionally receive
+arguments such as `-L`, `--extern`, and `--crate-type`, and the specified
+_args_ will simply be added to the compiler invocation.
+
+See for documentation on rustc
+flags.
+
+{{> description-one-target }}
+To pass flags to all compiler processes spawned by Cargo, use the `RUSTFLAGS`
+[environment variable](../reference/environment-variables.html) or the
+`build.rustflags` [config value](../reference/config.html).
+
+## OPTIONS
+
+{{> section-options-package }}
+
+### Target Selection
+
+When no target selection options are given, `cargo rustc` will build all
+binary and library targets of the selected package.
+
+{{> options-targets }}
+
+{{> section-features }}
+
+### Compilation Options
+
+{{#options}}
+
+{{> options-target-triple }}
+
+{{> options-release }}
+
+{{/options}}
+
+### Output Options
+
+{{#options}}
+{{> options-target-dir }}
+{{/options}}
+
+### Display Options
+
+{{#options}}
+
+{{> options-display }}
+
+{{> options-message-format }}
+
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+
+{{> options-manifest-path }}
+
+{{> options-locked }}
+
+{{/options}}
+
+{{> section-options-common }}
+
+### Miscellaneous Options
+
+{{#options}}
+{{> options-jobs }}
+{{/options}}
+
+{{> section-profiles }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Check if your package (not including dependencies) uses unsafe code:
+
+ cargo rustc --lib -- -D unsafe-code
+
+2. Try an experimental flag on the nightly compiler, such as this which prints
+ the size of every type:
+
+ cargo rustc --lib -- -Z print-type-sizes
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-build" 1}}, {{man "rustc" 1}}
diff --git a/src/doc/man/cargo-rustdoc.adoc b/src/doc/man/cargo-rustdoc.adoc
deleted file mode 100644
index 96f37252aaa..00000000000
--- a/src/doc/man/cargo-rustdoc.adoc
+++ /dev/null
@@ -1,98 +0,0 @@
-= cargo-rustdoc(1)
-:idprefix: cargo_rustdoc_
-:doctype: manpage
-:actionverb: Document
-
-== NAME
-
-cargo-rustdoc - Build a package's documentation, using specified custom flags
-
-== SYNOPSIS
-
-`cargo rustdoc [_OPTIONS_] [-- _ARGS_]`
-
-== DESCRIPTION
-
-The specified target for the current package (or package specified by `-p` if
-provided) will be documented with the specified _ARGS_ being passed to the
-final rustdoc invocation. Dependencies will not be documented as part of this
-command. Note that rustdoc will still unconditionally receive arguments such
-as `-L`, `--extern`, and `--crate-type`, and the specified _ARGS_ will simply
-be added to the rustdoc invocation.
-
-See https://doc.rust-lang.org/rustdoc/index.html for documentation on rustdoc
-flags.
-
-include::description-one-target.adoc[]
-To pass flags to all rustdoc processes spawned by Cargo, use the
-`RUSTDOCFLAGS` linkcargo:reference/environment-variables.html[environment variable]
-or the `build.rustdocflags` linkcargo:reference/config.html[config value].
-
-== OPTIONS
-
-=== Documentation 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.
-
-=== Package Selection
-
-include::options-package.adoc[]
-
-=== Target Selection
-
-When no target selection options are given, `cargo rustdoc` will document all
-binary and library targets of the selected package. The binary will be skipped
-if its name is the same as the lib target. Binaries are skipped if they have
-`required-features` that are missing.
-
-include::options-targets.adoc[]
-
-include::options-features.adoc[]
-
-=== Compilation Options
-
-include::options-target-triple.adoc[]
-
-include::options-release.adoc[]
-
-=== Output Options
-
-include::options-target-dir.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-include::options-message-format.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-=== Miscellaneous Options
-
-include::options-jobs.adoc[]
-
-include::section-profiles.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Build documentation with custom CSS included from a given file:
-
- cargo rustdoc --lib -- --extend-css extra.css
-
-== SEE ALSO
-man:cargo[1], man:cargo-doc[1], man:rustdoc[1]
diff --git a/src/doc/man/cargo-rustdoc.md b/src/doc/man/cargo-rustdoc.md
new file mode 100644
index 00000000000..958aa13c217
--- /dev/null
+++ b/src/doc/man/cargo-rustdoc.md
@@ -0,0 +1,108 @@
+# cargo-rustdoc(1)
+{{*set actionverb="Document"}}
+
+## NAME
+
+cargo-rustdoc - Build a package's documentation, using specified custom flags
+
+## SYNOPSIS
+
+`cargo rustdoc` [_options_] [`--` _args_]
+
+## DESCRIPTION
+
+The specified target for the current package (or package specified by `-p` if
+provided) will be documented with the specified _args_ being passed to the
+final rustdoc invocation. Dependencies will not be documented as part of this
+command. Note that rustdoc will still unconditionally receive arguments such
+as `-L`, `--extern`, and `--crate-type`, and the specified _args_ will simply
+be added to the rustdoc invocation.
+
+See for documentation on rustdoc
+flags.
+
+{{> description-one-target }}
+To pass flags to all rustdoc processes spawned by Cargo, use the
+`RUSTDOCFLAGS` [environment variable](../reference/environment-variables.html)
+or the `build.rustdocflags` [config value](../reference/config.html).
+
+## OPTIONS
+
+### Documentation Options
+
+{{#options}}
+
+{{#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.
+{{/option}}
+
+{{/options}}
+
+{{> section-options-package }}
+
+### Target Selection
+
+When no target selection options are given, `cargo rustdoc` will document all
+binary and library targets of the selected package. The binary will be skipped
+if its name is the same as the lib target. Binaries are skipped if they have
+`required-features` that are missing.
+
+{{> options-targets }}
+
+{{> section-features }}
+
+### Compilation Options
+
+{{#options}}
+
+{{> options-target-triple }}
+
+{{> options-release }}
+
+{{/options}}
+
+### Output Options
+
+{{#options}}
+{{> options-target-dir }}
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+
+{{> options-message-format }}
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+{{> options-manifest-path }}
+
+{{> options-locked }}
+{{/options}}
+
+{{> section-options-common }}
+
+### Miscellaneous Options
+
+{{#options}}
+{{> options-jobs }}
+{{/options}}
+
+{{> section-profiles }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Build documentation with custom CSS included from a given file:
+
+ cargo rustdoc --lib -- --extend-css extra.css
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-doc" 1}}, {{man "rustdoc" 1}}
diff --git a/src/doc/man/cargo-search.adoc b/src/doc/man/cargo-search.adoc
deleted file mode 100644
index 4d51285928f..00000000000
--- a/src/doc/man/cargo-search.adoc
+++ /dev/null
@@ -1,49 +0,0 @@
-= cargo-search(1)
-:idprefix: cargo_search_
-:doctype: manpage
-
-== NAME
-
-cargo-search - Search packages in crates.io
-
-== SYNOPSIS
-
-`cargo search [_OPTIONS_] [_QUERY_...]`
-
-== DESCRIPTION
-
-This performs a textual search for crates on https://crates.io. The matching
-crates will be displayed along with their description in TOML format suitable
-for copying into a `Cargo.toml` manifest.
-
-== OPTIONS
-
-=== Search Options
-
-*--limit* _LIMIT_::
- Limit the number of results (default: 10, max: 100).
-
-include::options-index.adoc[]
-
-include::options-registry.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Search for a package from crates.io:
-
- cargo search serde
-
-== SEE ALSO
-man:cargo[1], man:cargo-install[1], man:cargo-publish[1]
diff --git a/src/doc/man/cargo-search.md b/src/doc/man/cargo-search.md
new file mode 100644
index 00000000000..5c7bcac3c2f
--- /dev/null
+++ b/src/doc/man/cargo-search.md
@@ -0,0 +1,52 @@
+# cargo-search(1)
+
+## NAME
+
+cargo-search - Search packages in crates.io
+
+## SYNOPSIS
+
+`cargo search` [_options_] [_query_...]
+
+## DESCRIPTION
+
+This performs a textual search for crates on . The matching
+crates will be displayed along with their description in TOML format suitable
+for copying into a `Cargo.toml` manifest.
+
+## OPTIONS
+
+### Search Options
+
+{{#options}}
+
+{{#option "`--limit` _limit_" }}
+Limit the number of results (default: 10, max: 100).
+{{/option}}
+
+{{> options-index }}
+
+{{> options-registry }}
+
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Search for a package from crates.io:
+
+ cargo search serde
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-install" 1}}, {{man "cargo-publish" 1}}
diff --git a/src/doc/man/cargo-test.adoc b/src/doc/man/cargo-test.md
similarity index 65%
rename from src/doc/man/cargo-test.adoc
rename to src/doc/man/cargo-test.md
index ba338b12bfb..732ae14b10c 100644
--- a/src/doc/man/cargo-test.adoc
+++ b/src/doc/man/cargo-test.md
@@ -1,18 +1,16 @@
-= cargo-test(1)
-:idprefix: cargo_test_
-:doctype: manpage
-:actionverb: Test
-:nouns: tests
+# cargo-test(1)
+{{*set actionverb="Test"}}
+{{*set nouns="tests"}}
-== NAME
+## NAME
cargo-test - Execute unit and integration tests of a package
-== SYNOPSIS
+## SYNOPSIS
-`cargo test [_OPTIONS_] [TESTNAME] [-- _TEST-OPTIONS_]`
+`cargo test` [_options_] [_testname_] [`--` _test-options_]
-== DESCRIPTION
+## DESCRIPTION
Compile and execute unit and integration tests.
@@ -21,7 +19,7 @@ dashes (`--`) are passed to the test binaries and thus to _libtest_ (rustc's
built in unit-test and micro-benchmarking framework). If you're passing
arguments to both Cargo and the binary, the ones after `--` go to the binary,
the ones before go to Cargo. For details about libtest's arguments see the
-output of `cargo test \-- --help`.
+output of `cargo test -- --help`.
As an example, this will filter for tests with `foo` in their name and run them
on 3 threads in parallel:
@@ -30,7 +28,7 @@ on 3 threads in parallel:
Tests are built with the `--test` option to `rustc` which creates an
executable with a `main` function that automatically runs all functions
-annotated with the `\#[test]` attribute in multiple threads. `#[bench]`
+annotated with the `#[test]` attribute in multiple threads. `#[bench]`
annotated functions will also be run with one iteration to verify that they
are functional.
@@ -40,20 +38,18 @@ function to handle running tests.
Documentation tests are also run by default, which is handled by `rustdoc`. It
extracts code samples from documentation comments and executes them. See the
-link:https://doc.rust-lang.org/rustdoc/[rustdoc book] for more information on
+[rustdoc book](https://doc.rust-lang.org/rustdoc/) for more information on
writing doc tests.
-== OPTIONS
+## OPTIONS
-=== Test Options
+### Test Options
-include::options-test.adoc[]
+{{> options-test }}
-=== Package Selection
+{{> section-package-selection }}
-include::options-packages.adoc[]
-
-=== Target Selection
+### Target Selection
When no target selection options are given, `cargo test` will build the
following targets of the selected packages:
@@ -78,31 +74,42 @@ library in the manifest.
Binary targets are automatically built if there is an integration test or
benchmark. This allows an integration test to execute the binary to exercise
-and test its behavior. The `CARGO_BIN_EXE_`
-linkcargo:reference/environment-variables.html#environment-variables-cargo-sets-for-crates[environment variable]
+and test its behavior. The `CARGO_bin_EXE_`
+[environment variable](../reference/environment-variables.html#environment-variables-cargo-sets-for-crates)
is set when the integration test is built so that it can use the
-link:https://doc.rust-lang.org/std/macro.env.html[`env` macro] to locate the
+[`env` macro](https://doc.rust-lang.org/std/macro.env.html) to locate the
executable.
-include::options-targets.adoc[]
+{{> options-targets }}
+
+{{#options}}
+
+{{#option "`--doc`" }}
+Test only the library's documentation. This cannot be mixed with other
+target options.
+{{/option}}
+
+{{/options}}
+
+{{> section-features }}
-*--doc*::
- Test only the library's documentation. This cannot be mixed with other
- target options.
+### Compilation Options
-include::options-features.adoc[]
+{{#options}}
-=== Compilation Options
+{{> options-target-triple }}
-include::options-target-triple.adoc[]
+{{> options-release }}
-include::options-release.adoc[]
+{{/options}}
-=== Output Options
+### Output Options
-include::options-target-dir.adoc[]
+{{#options}}
+{{> options-target-dir }}
+{{/options}}
-=== Display Options
+### Display Options
By default the Rust test harness hides output from test execution to keep
results readable. Test output can be recovered (e.g., for debugging) by passing
@@ -110,21 +117,27 @@ results readable. Test output can be recovered (e.g., for debugging) by passing
cargo test -- --nocapture
-include::options-display.adoc[]
+{{#options}}
-include::options-message-format.adoc[]
+{{> options-display }}
-=== Manifest Options
+{{> options-message-format }}
-include::options-manifest-path.adoc[]
+{{/options}}
-include::options-locked.adoc[]
+### Manifest Options
-=== Common Options
+{{#options}}
-include::options-common.adoc[]
+{{> options-manifest-path }}
-=== Miscellaneous Options
+{{> options-locked }}
+
+{{/options}}
+
+{{> section-options-common }}
+
+### Miscellaneous Options
The `--jobs` argument affects the building of the test executable but does not
affect how many threads are used when running the tests. The Rust test harness
@@ -132,9 +145,13 @@ includes an option to control the number of threads used:
cargo test -j 2 -- --test-threads=2
-include::options-jobs.adoc[]
+{{#options}}
+
+{{> options-jobs }}
+
+{{/options}}
-include::section-profiles.adoc[]
+{{> section-profiles }}
Unit tests are separate executable artifacts which use the `test`/`bench`
profiles. Example targets are built the same as with `cargo build` (using the
@@ -144,23 +161,23 @@ which case they use the `test`/`bench` profiles. Library targets are built
with the `dev`/`release` profiles when linked to an integration test, binary,
or doctest.
-include::section-environment.adoc[]
+{{> section-environment }}
-include::section-exit-status.adoc[]
+{{> section-exit-status }}
-== EXAMPLES
+## EXAMPLES
-. Execute all the unit and integration tests of the current package:
+1. Execute all the unit and integration tests of the current package:
- cargo test
+ cargo test
-. Run only tests whose names match against a filter string:
+2. Run only tests whose names match against a filter string:
- cargo test name_filter
+ cargo test name_filter
-. Run only a specific test within a specific integration test:
+3. Run only a specific test within a specific integration test:
- cargo test --test int_test_name -- modname::test_name
+ cargo test --test int_test_name -- modname::test_name
-== SEE ALSO
-man:cargo[1], man:cargo-bench[1]
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-bench" 1}}
diff --git a/src/doc/man/cargo-tree.adoc b/src/doc/man/cargo-tree.adoc
deleted file mode 100644
index 86b3276a48e..00000000000
--- a/src/doc/man/cargo-tree.adoc
+++ /dev/null
@@ -1,227 +0,0 @@
-= cargo-tree(1)
-:idprefix: cargo_tree_
-:doctype: manpage
-:actionverb: Display
-:noall: true
-
-== NAME
-
-cargo-tree - Display a tree visualization of a dependency graph
-
-== SYNOPSIS
-
-`cargo tree [_OPTIONS_]`
-
-== DESCRIPTION
-
-This command will display a tree of dependencies to the terminal. An example
-of a simple project that depends on the "rand" package:
-
-----
-myproject v0.1.0 (/myproject)
-└── rand v0.7.3
- ├── getrandom v0.1.14
- │ ├── cfg-if v0.1.10
- │ └── libc v0.2.68
- ├── libc v0.2.68 (*)
- ├── rand_chacha v0.2.2
- │ ├── ppv-lite86 v0.2.6
- │ └── rand_core v0.5.1
- │ └── getrandom v0.1.14 (*)
- └── rand_core v0.5.1 (*)
-[build-dependencies]
-└── cc v1.0.50
-----
-
-Packages marked with `(*)` have been "de-duplicated". The dependencies for the
-package have already been shown elswhere in the graph, and so are not
-repeated. Use the `--no-dedupe` option to repeat the duplicates.
-
-The `-e` flag can be used to select the dependency kinds to display. The
-"features" kind changes the output to display the features enabled by
-each dependency. For example, `cargo tree -e features`:
-
-----
-myproject v0.1.0 (/myproject)
-└── log feature "serde"
- └── log v0.4.8
- ├── serde v1.0.106
- └── cfg-if feature "default"
- └── cfg-if v0.1.10
-----
-
-In this tree, `myproject` depends on `log` with the `serde` feature. `log` in
-turn depends on `cfg-if` with "default" features. When using `-e features` it
-can be helpful to use `-i` flag to show how the features flow into a package.
-See the examples below for more detail.
-
-== OPTIONS
-
-=== Tree Options
-
-*-i* _SPEC_::
-*--invert* _SPEC_::
- Show the reverse dependencies for the given package. This flag will invert
- the tree and display the packages that depend on the given package.
-+
-Note that in a workspace, by default it will only display the package's
-reverse dependencies inside the tree of the workspace member in the current
-directory. The `--workspace` flag can be used to extend it so that it will
-show the package's reverse dependencies across the entire workspace. The `-p`
-flag can be used to display the package's reverse dependencies only with the
-subtree of the package given to `-p`.
-
-*--no-dedupe*::
- Do not de-duplicate repeated dependencies. Usually, when a package has
- already displayed its dependencies, further occurrences will not
- re-display its dependencies, and will include a `(*)` to indicate it has
- already been shown. This flag will cause those duplicates to be repeated.
-
-*-d*::
-*--duplicates*::
- Show only dependencies which come in multiple versions (implies
- `--invert`). When used with the `-p` flag, only shows duplicates within
- the subtree of the given package.
-+
-It can be beneficial for build times and executable sizes to avoid building
-that same package multiple times. This flag can help identify the offending
-packages. You can then investigate if the package that depends on the
-duplicate with the older version can be updated to the newer version so that
-only one instance is built.
-
-*-e* _KINDS_::
-*--edges* _KINDS_::
- The dependency kinds to display. Takes a comma separated list of values:
-+
- - `all` — Show all edge kinds.
- - `normal` — Show normal dependencies.
- - `build` — Show build dependencies.
- - `dev` — Show development dependencies.
- - `features` — Show features enabled by each dependency. If this is
- the only kind given, then it will automatically include the other
- dependency kinds.
- - `no-normal` — Do not include normal dependencies.
- - `no-build` — Do not include build dependencies.
- - `no-dev` — Do not include development dependencies.
-+
-The `no-` prefixed options cannot be mixed with the other dependency kinds.
-+
-The default is `normal,build,dev`.
-
-*--target* _TRIPLE_::
- Filter dependencies matching the given target-triple.
- The default is the host platform. Use the value `all` to include *all*
- targets.
-
-=== Tree Formatting Options
-
-*--charset* _CHARSET_::
- Chooses the character set to use for the tree. Valid values are "utf8" or
- "ascii". Default is "utf8".
-
-*-f* _FORMAT_::
-*--format* _FORMAT_::
- Set the format string for each package. The default is "{p}".
-+
-This is an arbitrary string which will be used to display each package. The following
-strings will be replaced with the corresponding value:
-+
-- `{p}` — The package name.
-- `{l}` — The package license.
-- `{r}` — The package repository URL.
-- `{f}` — Comma-separated list of package features that are enabled.
-
-*--prefix* _PREFIX_::
- Sets how each line is displayed. The _PREFIX_ value can be one of:
-+
-- `indent` (default) — Shows each line indented as a tree.
-- `depth` — Show as a list, with the numeric depth printed before each entry.
-- `none` — Show as a flat list.
-
-=== Package Selection
-
-include::options-packages.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-features.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::options-locked.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Display the tree for the package in the current directory:
-
- cargo tree
-
-. Display all the packages that depend on the `syn` package:
-
- cargo tree -i syn
-
-. Show the features enabled on each package:
-
- cargo tree --format "{p} {f}"
-
-. Show all packages that are built multiple times. This can happen if multiple
- semver-incompatible versions appear in the tree (like 1.0.0 and 2.0.0).
-
- cargo tree -d
-
-. Explain why features are enabled for the `syn` package:
-
- cargo tree -e features -i syn
-+
-The `-e features` flag is used to show features. The `-i` flag is used to
-invert the graph so that it displays the packages that depend on `syn`. An
-example of what this would display:
-+
-----
-syn v1.0.17
-├── syn feature "clone-impls"
-│ └── syn feature "default"
-│ └── rustversion v1.0.2
-│ └── rustversion feature "default"
-│ └── myproject v0.1.0 (/myproject)
-│ └── myproject feature "default" (command-line)
-├── syn feature "default" (*)
-├── syn feature "derive"
-│ └── syn feature "default" (*)
-├── syn feature "full"
-│ └── rustversion v1.0.2 (*)
-├── syn feature "parsing"
-│ └── syn feature "default" (*)
-├── syn feature "printing"
-│ └── syn feature "default" (*)
-├── syn feature "proc-macro"
-│ └── syn feature "default" (*)
-└── syn feature "quote"
- ├── syn feature "printing" (*)
- └── syn feature "proc-macro" (*)
-----
-+
-To read this graph, you can follow the chain for each feature from the root to
-see why it is included. For example, the "full" feature is added by the
-`rustversion` crate which is included from `myproject` (with the default
-features), and `myproject` is the package selected on the command-line. All
-of the other `syn` features are added by the "default" feature ("quote" is
-added by "printing" and "proc-macro", both of which are default features).
-+
-If you're having difficulty cross-referencing the de-duplicated `(*)` entries,
-try with the `--no-dedupe` flag to get the full output.
-
-== SEE ALSO
-man:cargo[1], man:cargo-metadata[1]
diff --git a/src/doc/man/cargo-tree.md b/src/doc/man/cargo-tree.md
new file mode 100644
index 00000000000..dc691e3461e
--- /dev/null
+++ b/src/doc/man/cargo-tree.md
@@ -0,0 +1,239 @@
+# cargo-tree(1)
+{{*set actionverb="Display"}}
+{{*set noall=true}}
+
+## NAME
+
+cargo-tree - Display a tree visualization of a dependency graph
+
+## SYNOPSIS
+
+`cargo tree` [_options_]
+
+## DESCRIPTION
+
+This command will display a tree of dependencies to the terminal. An example
+of a simple project that depends on the "rand" package:
+
+```
+myproject v0.1.0 (/myproject)
+└── rand v0.7.3
+ ├── getrandom v0.1.14
+ │ ├── cfg-if v0.1.10
+ │ └── libc v0.2.68
+ ├── libc v0.2.68 (*)
+ ├── rand_chacha v0.2.2
+ │ ├── ppv-lite86 v0.2.6
+ │ └── rand_core v0.5.1
+ │ └── getrandom v0.1.14 (*)
+ └── rand_core v0.5.1 (*)
+[build-dependencies]
+└── cc v1.0.50
+```
+
+Packages marked with `(*)` have been "de-duplicated". The dependencies for the
+package have already been shown elswhere in the graph, and so are not
+repeated. Use the `--no-dedupe` option to repeat the duplicates.
+
+The `-e` flag can be used to select the dependency kinds to display. The
+"features" kind changes the output to display the features enabled by
+each dependency. For example, `cargo tree -e features`:
+
+```
+myproject v0.1.0 (/myproject)
+└── log feature "serde"
+ └── log v0.4.8
+ ├── serde v1.0.106
+ └── cfg-if feature "default"
+ └── cfg-if v0.1.10
+```
+
+In this tree, `myproject` depends on `log` with the `serde` feature. `log` in
+turn depends on `cfg-if` with "default" features. When using `-e features` it
+can be helpful to use `-i` flag to show how the features flow into a package.
+See the examples below for more detail.
+
+## OPTIONS
+
+### Tree Options
+
+{{#options}}
+
+{{#option "`-i` _spec_" "`--invert` _spec_" }}
+Show the reverse dependencies for the given package. This flag will invert
+the tree and display the packages that depend on the given package.
+
+Note that in a workspace, by default it will only display the package's
+reverse dependencies inside the tree of the workspace member in the current
+directory. The `--workspace` flag can be used to extend it so that it will
+show the package's reverse dependencies across the entire workspace. The `-p`
+flag can be used to display the package's reverse dependencies only with the
+subtree of the package given to `-p`.
+{{/option}}
+
+{{#option "`--no-dedupe`" }}
+Do not de-duplicate repeated dependencies. Usually, when a package has already
+displayed its dependencies, further occurrences will not re-display its
+dependencies, and will include a `(*)` to indicate it has already been shown.
+This flag will cause those duplicates to be repeated.
+{{/option}}
+
+{{#option "`-d`" "`--duplicates`" }}
+Show only dependencies which come in multiple versions (implies `--invert`).
+When used with the `-p` flag, only shows duplicates within the subtree of the
+given package.
+
+It can be beneficial for build times and executable sizes to avoid building
+that same package multiple times. This flag can help identify the offending
+packages. You can then investigate if the package that depends on the
+duplicate with the older version can be updated to the newer version so that
+only one instance is built.
+{{/option}}
+
+{{#option "`-e` _kinds_" "`--edges` _kinds_" }}
+The dependency kinds to display. Takes a comma separated list of values:
+
+- `all` — Show all edge kinds.
+- `normal` — Show normal dependencies.
+- `build` — Show build dependencies.
+- `dev` — Show development dependencies.
+- `features` — Show features enabled by each dependency. If this is the only
+ kind given, then it will automatically include the other dependency kinds.
+- `no-normal` — Do not include normal dependencies.
+- `no-build` — Do not include build dependencies.
+- `no-dev` — Do not include development dependencies.
+
+The `no-` prefixed options cannot be mixed with the other dependency kinds.
+
+The default is `normal,build,dev`.
+{{/option}}
+
+{{#option "`--target` _triple_" }}
+Filter dependencies matching the given target-triple. The default is the host
+platform. Use the value `all` to include *all* targets.
+{{/option}}
+
+{{/options}}
+
+### Tree Formatting Options
+
+{{#options}}
+
+{{#option "`--charset` _charset_" }}
+Chooses the character set to use for the tree. Valid values are "utf8" or
+"ascii". Default is "utf8".
+{{/option}}
+
+{{#option "`-f` _format_" "`--format` _format_" }}
+Set the format string for each package. The default is "{p}".
+
+This is an arbitrary string which will be used to display each package. The following
+strings will be replaced with the corresponding value:
+
+- `{p}` — The package name.
+- `{l}` — The package license.
+- `{r}` — The package repository URL.
+- `{f}` — Comma-separated list of package features that are enabled.
+{{/option}}
+
+{{#option "`--prefix` _prefix_" }}
+Sets how each line is displayed. The _prefix_ value can be one of:
+
+- `indent` (default) — Shows each line indented as a tree.
+- `depth` — Show as a list, with the numeric depth printed before each entry.
+- `none` — Show as a flat list.
+{{/option}}
+
+{{/options}}
+
+{{> section-package-selection }}
+
+### Manifest Options
+
+{{#options}}
+
+{{> options-manifest-path }}
+
+{{> options-locked }}
+
+{{/options}}
+
+{{> section-features }}
+
+### Display Options
+
+{{#options}}
+
+{{> options-display }}
+
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Display the tree for the package in the current directory:
+
+ cargo tree
+
+2. Display all the packages that depend on the `syn` package:
+
+ cargo tree -i syn
+
+3. Show the features enabled on each package:
+
+ cargo tree --format "{p} {f}"
+
+4. Show all packages that are built multiple times. This can happen if multiple
+ semver-incompatible versions appear in the tree (like 1.0.0 and 2.0.0).
+
+ cargo tree -d
+
+5. Explain why features are enabled for the `syn` package:
+
+ cargo tree -e features -i syn
+
+ The `-e features` flag is used to show features. The `-i` flag is used to
+ invert the graph so that it displays the packages that depend on `syn`. An
+ example of what this would display:
+
+ ```
+ syn v1.0.17
+ ├── syn feature "clone-impls"
+ │ └── syn feature "default"
+ │ └── rustversion v1.0.2
+ │ └── rustversion feature "default"
+ │ └── myproject v0.1.0 (/myproject)
+ │ └── myproject feature "default" (command-line)
+ ├── syn feature "default" (*)
+ ├── syn feature "derive"
+ │ └── syn feature "default" (*)
+ ├── syn feature "full"
+ │ └── rustversion v1.0.2 (*)
+ ├── syn feature "parsing"
+ │ └── syn feature "default" (*)
+ ├── syn feature "printing"
+ │ └── syn feature "default" (*)
+ ├── syn feature "proc-macro"
+ │ └── syn feature "default" (*)
+ └── syn feature "quote"
+ ├── syn feature "printing" (*)
+ └── syn feature "proc-macro" (*)
+ ```
+
+ To read this graph, you can follow the chain for each feature from the root
+ to see why it is included. For example, the "full" feature is added by the
+ `rustversion` crate which is included from `myproject` (with the default
+ features), and `myproject` is the package selected on the command-line. All
+ of the other `syn` features are added by the "default" feature ("quote" is
+ added by "printing" and "proc-macro", both of which are default features).
+
+ If you're having difficulty cross-referencing the de-duplicated `(*)`
+ entries, try with the `--no-dedupe` flag to get the full output.
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-metadata" 1}}
diff --git a/src/doc/man/cargo-uninstall.adoc b/src/doc/man/cargo-uninstall.adoc
deleted file mode 100644
index b75a10401e2..00000000000
--- a/src/doc/man/cargo-uninstall.adoc
+++ /dev/null
@@ -1,57 +0,0 @@
-= cargo-uninstall(1)
-:idprefix: cargo_uninstall_
-:doctype: manpage
-
-== NAME
-
-cargo-uninstall - Remove a Rust binary
-
-== SYNOPSIS
-
-`cargo uninstall [_OPTIONS_] [_SPEC_...]`
-
-== DESCRIPTION
-
-This command removes a package installed with man:cargo-install[1]. The _SPEC_
-argument is a package ID specification of the package to remove (see
-man:cargo-pkgid[1]).
-
-By default all binaries are removed for a crate but the `--bin` and
-`--example` flags can be used to only remove particular binaries.
-
-include::description-install-root.adoc[]
-
-== OPTIONS
-
-=== Install Options
-
-*-p*::
-*--package* _SPEC_...::
- Package to uninstall.
-
-*--bin* _NAME_...::
- Only uninstall the binary _NAME_.
-
-*--root* _DIR_::
- Directory to uninstall packages from.
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Uninstall a previously installed package.
-
- cargo uninstall ripgrep
-
-== SEE ALSO
-man:cargo[1], man:cargo-install[1]
diff --git a/src/doc/man/cargo-uninstall.md b/src/doc/man/cargo-uninstall.md
new file mode 100644
index 00000000000..73c50c7a1de
--- /dev/null
+++ b/src/doc/man/cargo-uninstall.md
@@ -0,0 +1,63 @@
+# cargo-uninstall(1)
+
+## NAME
+
+cargo-uninstall - Remove a Rust binary
+
+## SYNOPSIS
+
+`cargo uninstall` [_options_] [_spec_...]
+
+## DESCRIPTION
+
+This command removes a package installed with {{man "cargo-install" 1}}. The _spec_
+argument is a package ID specification of the package to remove (see
+{{man "cargo-pkgid" 1}}).
+
+By default all binaries are removed for a crate but the `--bin` and
+`--example` flags can be used to only remove particular binaries.
+
+{{> description-install-root }}
+
+## OPTIONS
+
+### Install Options
+
+{{#options}}
+
+{{#option "`-p`" "`--package` _spec_..." }}
+Package to uninstall.
+{{/option}}
+
+{{#option "`--bin` _name_..." }}
+Only uninstall the binary _name_.
+{{/option}}
+
+{{#option "`--root` _dir_" }}
+Directory to uninstall packages from.
+{{/option}}
+
+{{/options}}
+
+### Display Options
+
+{{#options}}
+
+{{> options-display }}
+
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Uninstall a previously installed package.
+
+ cargo uninstall ripgrep
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-install" 1}}
diff --git a/src/doc/man/cargo-update.adoc b/src/doc/man/cargo-update.adoc
deleted file mode 100644
index c8a5274350a..00000000000
--- a/src/doc/man/cargo-update.adoc
+++ /dev/null
@@ -1,81 +0,0 @@
-= cargo-update(1)
-:idprefix: cargo_update_
-:doctype: manpage
-
-== NAME
-
-cargo-update - Update dependencies as recorded in the local lock file
-
-== SYNOPSIS
-
-`cargo update [_OPTIONS_]`
-
-== DESCRIPTION
-
-This command will update dependencies in the `Cargo.lock` file to the latest
-version. It requires that the `Cargo.lock` file already exists as generated
-by commands such as man:cargo-build[1] or man:cargo-generate-lockfile[1].
-
-== OPTIONS
-
-=== Update Options
-
-*-p* _SPEC_...::
-*--package* _SPEC_...::
- Update only the specified packages. This flag may be specified
- multiple times. See man:cargo-pkgid[1] for the SPEC format.
-+
-If packages are specified with the `-p` flag, then a conservative update of
-the lockfile will be performed. This means that only the dependency specified
-by SPEC will be updated. Its transitive dependencies will be updated only if
-SPEC cannot be updated without updating dependencies. All other dependencies
-will remain locked at their currently recorded versions.
-+
-If `-p` is not specified, all dependencies are updated.
-
-*--aggressive*::
- When used with `-p`, dependencies of _SPEC_ are forced to update as well.
- Cannot be used with `--precise`.
-
-*--precise* _PRECISE_::
- When used with `-p`, allows you to specify a specific version number to
- set the package to. If the package comes from a git repository, this can
- be a git revision (such as a SHA hash or tag).
-
-*--dry-run*::
- Displays what would be updated, but doesn't actually write the lockfile.
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Update all dependencies in the lockfile:
-
- cargo update
-
-. Update only specific dependencies:
-
- cargo update -p foo -p bar
-
-. Set a specific dependency to a specific version:
-
- cargo update -p foo --precise 1.2.3
-
-== SEE ALSO
-man:cargo[1], man:cargo-generate-lockfile[1]
diff --git a/src/doc/man/cargo-update.md b/src/doc/man/cargo-update.md
new file mode 100644
index 00000000000..db0210b8bfe
--- /dev/null
+++ b/src/doc/man/cargo-update.md
@@ -0,0 +1,90 @@
+# cargo-update(1)
+
+## NAME
+
+cargo-update - Update dependencies as recorded in the local lock file
+
+## SYNOPSIS
+
+`cargo update` [_options_]
+
+## DESCRIPTION
+
+This command will update dependencies in the `Cargo.lock` file to the latest
+version. It requires that the `Cargo.lock` file already exists as generated
+by commands such as {{man "cargo-build" 1}} or {{man "cargo-generate-lockfile" 1}}.
+
+## OPTIONS
+
+### Update Options
+
+{{#options}}
+
+{{#option "`-p` _spec_..." "`--package` _spec_..." }}
+Update only the specified packages. This flag may be specified
+multiple times. See {{man "cargo-pkgid" 1}} for the SPEC format.
+
+If packages are specified with the `-p` flag, then a conservative update of
+the lockfile will be performed. This means that only the dependency specified
+by SPEC will be updated. Its transitive dependencies will be updated only if
+SPEC cannot be updated without updating dependencies. All other dependencies
+will remain locked at their currently recorded versions.
+
+If `-p` is not specified, all dependencies are updated.
+{{/option}}
+
+{{#option "`--aggressive`" }}
+When used with `-p`, dependencies of _spec_ are forced to update as well.
+Cannot be used with `--precise`.
+{{/option}}
+
+{{#option "`--precise` _precise_" }}
+When used with `-p`, allows you to specify a specific version number to set
+the package to. If the package comes from a git repository, this can be a git
+revision (such as a SHA hash or tag).
+{{/option}}
+
+{{#option "`--dry-run`" }}
+Displays what would be updated, but doesn't actually write the lockfile.
+{{/option}}
+
+{{/options}}
+
+### Display Options
+
+{{#options}}
+{{> options-display }}
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+
+{{> options-manifest-path }}
+
+{{> options-locked }}
+
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Update all dependencies in the lockfile:
+
+ cargo update
+
+2. Update only specific dependencies:
+
+ cargo update -p foo -p bar
+
+3. Set a specific dependency to a specific version:
+
+ cargo update -p foo --precise 1.2.3
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-generate-lockfile" 1}}
diff --git a/src/doc/man/cargo-vendor.adoc b/src/doc/man/cargo-vendor.adoc
deleted file mode 100644
index d1d3fc3bb87..00000000000
--- a/src/doc/man/cargo-vendor.adoc
+++ /dev/null
@@ -1,82 +0,0 @@
-= cargo-vendor(1)
-:idprefix: cargo_vendor_
-:doctype: manpage
-
-== NAME
-
-cargo-vendor - Vendor all dependencies locally
-
-== SYNOPSIS
-
-`cargo vendor [_OPTIONS_] [_PATH_]`
-
-== DESCRIPTION
-
-This cargo subcommand will vendor all crates.io and git dependencies for a
-project into the specified directory at ``. After this command completes
-the vendor directory specified by `` will contain all remote sources from
-dependencies specified. Additional manifests beyond the default one can be
-specified with the `-s` option.
-
-The `cargo vendor` command will also print out the configuration necessary
-to use the vendored sources, which you will need to add to `.cargo/config.toml`.
-
-== OPTIONS
-
-=== Vendor Options
-
-*-s* _MANIFEST_::
-*--sync* _MANIFEST_::
- Specify extra `Cargo.toml` manifests to workspaces which should also be
- vendored and synced to the output.
-
-*--no-delete*::
- Don't delete the "vendor" directory when vendoring, but rather keep all
- existing contents of the vendor directory
-
-*--respect-source-config*::
- Instead of ignoring `[source]` configuration by default in `.cargo/config.toml`
- read it and use it when downloading crates from crates.io, for example
-
-*--versioned-dirs*::
- Normally versions are only added to disambiguate multiple versions of the
- same package. This option causes all directories in the "vendor" directory
- to be versioned, which makes it easier to track the history of vendored
- packages over time, and can help with the performance of re-vendoring when
- only a subset of the packages have changed.
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::options-locked.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Vendor all dependencies into a local "vendor" folder
-
- cargo vendor
-
-. Vendor all dependencies into a local "third-party/vendor" folder
-
- cargo vendor third-party/vendor
-
-. Vendor the current workspace as well as another to "vendor"
-
- cargo vendor -s ../path/to/Cargo.toml
-
-== SEE ALSO
-man:cargo[1]
-
diff --git a/src/doc/man/cargo-vendor.md b/src/doc/man/cargo-vendor.md
new file mode 100644
index 00000000000..f7c4532035c
--- /dev/null
+++ b/src/doc/man/cargo-vendor.md
@@ -0,0 +1,93 @@
+# cargo-vendor(1)
+
+## NAME
+
+cargo-vendor - Vendor all dependencies locally
+
+## SYNOPSIS
+
+`cargo vendor` [_options_] [_path_]
+
+## DESCRIPTION
+
+This cargo subcommand will vendor all crates.io and git dependencies for a
+project into the specified directory at ``. After this command completes
+the vendor directory specified by `` will contain all remote sources from
+dependencies specified. Additional manifests beyond the default one can be
+specified with the `-s` option.
+
+The `cargo vendor` command will also print out the configuration necessary
+to use the vendored sources, which you will need to add to `.cargo/config.toml`.
+
+## OPTIONS
+
+### Vendor Options
+
+{{#options}}
+
+{{#option "`-s` _manifest_" "`--sync` _manifest_" }}
+Specify extra `Cargo.toml` manifests to workspaces which should also be
+vendored and synced to the output.
+{{/option}}
+
+{{#option "`--no-delete`" }}
+Don't delete the "vendor" directory when vendoring, but rather keep all
+existing contents of the vendor directory
+{{/option}}
+
+{{#option "`--respect-source-config`" }}
+Instead of ignoring `[source]` configuration by default in `.cargo/config.toml`
+read it and use it when downloading crates from crates.io, for example
+{{/option}}
+
+{{#option "`--versioned-dirs`" }}
+Normally versions are only added to disambiguate multiple versions of the
+same package. This option causes all directories in the "vendor" directory
+to be versioned, which makes it easier to track the history of vendored
+packages over time, and can help with the performance of re-vendoring when
+only a subset of the packages have changed.
+{{/option}}
+
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+
+{{> options-manifest-path }}
+
+{{> options-locked }}
+
+{{/options}}
+
+### Display Options
+
+{{#options}}
+
+{{> options-display }}
+
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Vendor all dependencies into a local "vendor" folder
+
+ cargo vendor
+
+2. Vendor all dependencies into a local "third-party/vendor" folder
+
+ cargo vendor third-party/vendor
+
+3. Vendor the current workspace as well as another to "vendor"
+
+ cargo vendor -s ../path/to/Cargo.toml
+
+## SEE ALSO
+{{man "cargo" 1}}
+
diff --git a/src/doc/man/cargo-verify-project.adoc b/src/doc/man/cargo-verify-project.adoc
deleted file mode 100644
index 7b963f8c5dd..00000000000
--- a/src/doc/man/cargo-verify-project.adoc
+++ /dev/null
@@ -1,57 +0,0 @@
-= cargo-verify-project(1)
-:idprefix: cargo_verify-project_
-:doctype: manpage
-
-== NAME
-
-cargo-verify-project - Check correctness of crate manifest
-
-== SYNOPSIS
-
-`cargo verify-project [_OPTIONS_]`
-
-== DESCRIPTION
-
-This command will parse the local manifest and check its validity. It emits a
-JSON object with the result. A successful validation will display:
-
- {"success":"true"}
-
-An invalid workspace will display:
-
- {"invalid":"human-readable error message"}
-
-== OPTIONS
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Manifest Options
-
-include::options-manifest-path.adoc[]
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-== Exit Status
-
-0::
- The workspace is OK.
-
-1::
- The workspace is invalid.
-
-== EXAMPLES
-
-. Check the current workspace for errors:
-
- cargo verify-project
-
-== SEE ALSO
-man:cargo[1], man:cargo-package[1]
diff --git a/src/doc/man/cargo-verify-project.md b/src/doc/man/cargo-verify-project.md
new file mode 100644
index 00000000000..99b749087b7
--- /dev/null
+++ b/src/doc/man/cargo-verify-project.md
@@ -0,0 +1,58 @@
+# cargo-verify-project(1)
+
+## NAME
+
+cargo-verify-project - Check correctness of crate manifest
+
+## SYNOPSIS
+
+`cargo verify-project` [_options_]
+
+## DESCRIPTION
+
+This command will parse the local manifest and check its validity. It emits a
+JSON object with the result. A successful validation will display:
+
+ {"success":"true"}
+
+An invalid workspace will display:
+
+ {"invalid":"human-readable error message"}
+
+## OPTIONS
+
+### Display Options
+
+{{#options}}
+
+{{> options-display }}
+
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+
+{{> options-manifest-path }}
+
+{{> options-locked }}
+
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+## EXIT STATUS
+
+* `0`: The workspace is OK.
+* `1`: The workspace is invalid.
+
+## EXAMPLES
+
+1. Check the current workspace for errors:
+
+ cargo verify-project
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-package" 1}}
diff --git a/src/doc/man/cargo-version.adoc b/src/doc/man/cargo-version.adoc
deleted file mode 100644
index 4c3bb7a1be3..00000000000
--- a/src/doc/man/cargo-version.adoc
+++ /dev/null
@@ -1,39 +0,0 @@
-= cargo-version(1)
-:idprefix: cargo_version_
-:doctype: manpage
-
-== NAME
-
-cargo-version - Show version information
-
-== SYNOPSIS
-
-`cargo version [_OPTIONS_]`
-
-== DESCRIPTION
-
-Displays the version of Cargo.
-
-== OPTIONS
-
-*-v*::
-*--verbose*::
- Display additional version information.
-
-== EXAMPLES
-
-. Display the version:
-
- cargo version
-
-. The version is also available via flags:
-
- cargo --version
- cargo -V
-
-. Display extra version information:
-
- cargo -Vv
-
-== SEE ALSO
-man:cargo[1]
diff --git a/src/doc/man/cargo-version.md b/src/doc/man/cargo-version.md
new file mode 100644
index 00000000000..c6e4535323d
--- /dev/null
+++ b/src/doc/man/cargo-version.md
@@ -0,0 +1,41 @@
+# cargo-version(1)
+
+## NAME
+
+cargo-version - Show version information
+
+## SYNOPSIS
+
+`cargo version` [_options_]
+
+## DESCRIPTION
+
+Displays the version of Cargo.
+
+## OPTIONS
+
+{{#options}}
+
+{{#option "`-v`" "`--verbose`" }}
+Display additional version information.
+{{/option}}
+
+{{/options}}
+
+## EXAMPLES
+
+1. Display the version:
+
+ cargo version
+
+2. The version is also available via flags:
+
+ cargo --version
+ cargo -V
+
+3. Display extra version information:
+
+ cargo -Vv
+
+## SEE ALSO
+{{man "cargo" 1}}
diff --git a/src/doc/man/cargo-yank.adoc b/src/doc/man/cargo-yank.adoc
deleted file mode 100644
index a08c71777a0..00000000000
--- a/src/doc/man/cargo-yank.adoc
+++ /dev/null
@@ -1,64 +0,0 @@
-= cargo-yank(1)
-:idprefix: cargo_yank_
-:doctype: manpage
-
-== NAME
-
-cargo-yank - Remove a pushed crate from the index
-
-== SYNOPSIS
-
-`cargo yank [_OPTIONS_] --vers _VERSION_ [_CRATE_]`
-
-== DESCRIPTION
-
-The yank command removes a previously published crate's version from the
-server's index. This command does not delete any data, and the crate will
-still be available for download via the registry's download link.
-
-Note that existing crates locked to a yanked version will still be able to
-download the yanked version to use it. Cargo will, however, not allow any new
-crates to be locked to any yanked version.
-
-This command requires you to be authenticated with either the `--token` option
-or using man:cargo-login[1].
-
-If the crate name is not specified, it will use the package name from the
-current directory.
-
-== OPTIONS
-
-=== Yank Options
-
-*--vers* _VERSION_::
- The version to yank or un-yank.
-
-*--undo*::
- Undo a yank, putting a version back into the index.
-
-include::options-token.adoc[]
-
-include::options-index.adoc[]
-
-include::options-registry.adoc[]
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== EXAMPLES
-
-. Yank a crate from the index:
-
- cargo yank --vers 1.0.7 foo
-
-== SEE ALSO
-man:cargo[1], man:cargo-login[1], man:cargo-publish[1]
diff --git a/src/doc/man/cargo-yank.md b/src/doc/man/cargo-yank.md
new file mode 100644
index 00000000000..0a3ba396585
--- /dev/null
+++ b/src/doc/man/cargo-yank.md
@@ -0,0 +1,70 @@
+# cargo-yank(1)
+
+## NAME
+
+cargo-yank - Remove a pushed crate from the index
+
+## SYNOPSIS
+
+`cargo yank` [_options_] `--vers` _version_ [_crate_]
+
+## DESCRIPTION
+
+The yank command removes a previously published crate's version from the
+server's index. This command does not delete any data, and the crate will
+still be available for download via the registry's download link.
+
+Note that existing crates locked to a yanked version will still be able to
+download the yanked version to use it. Cargo will, however, not allow any new
+crates to be locked to any yanked version.
+
+This command requires you to be authenticated with either the `--token` option
+or using {{man "cargo-login" 1}}.
+
+If the crate name is not specified, it will use the package name from the
+current directory.
+
+## OPTIONS
+
+### Yank Options
+
+{{#options}}
+
+{{#option "`--vers` _version_" }}
+The version to yank or un-yank.
+{{/option}}
+
+{{#option "`--undo`" }}
+Undo a yank, putting a version back into the index.
+{{/option}}
+
+{{> options-token }}
+
+{{> options-index }}
+
+{{> options-registry }}
+
+{{/options}}
+
+### Display Options
+
+{{#options}}
+
+{{> options-display }}
+
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## EXAMPLES
+
+1. Yank a crate from the index:
+
+ cargo yank --vers 1.0.7 foo
+
+## SEE ALSO
+{{man "cargo" 1}}, {{man "cargo-login" 1}}, {{man "cargo-publish" 1}}
diff --git a/src/doc/man/cargo.adoc b/src/doc/man/cargo.adoc
deleted file mode 100644
index 59c7b1fccc9..00000000000
--- a/src/doc/man/cargo.adoc
+++ /dev/null
@@ -1,226 +0,0 @@
-= cargo(1)
-:doctype: manpage
-
-== NAME
-
-cargo - The Rust package manager
-
-== SYNOPSIS
-
-[%hardbreaks]
-`cargo [_OPTIONS_] _COMMAND_ [_ARGS_]`
-`cargo [_OPTIONS_] --version`
-`cargo [_OPTIONS_] --list`
-`cargo [_OPTIONS_] --help`
-`cargo [_OPTIONS_] --explain _CODE_`
-
-== DESCRIPTION
-
-This program is a package manager and build tool for the Rust language,
-available at .
-
-== COMMANDS
-
-=== Build Commands
-
-man:cargo-bench[1]::
- Execute benchmarks of a package.
-
-man:cargo-build[1]::
- Compile a package.
-
-man:cargo-check[1]::
- Check a local package and all of its dependencies for errors.
-
-man:cargo-clean[1]::
- Remove artifacts that Cargo has generated in the past.
-
-man:cargo-doc[1]::
- Build a package's documentation.
-
-man:cargo-fetch[1]::
- Fetch dependencies of a package from the network.
-
-man:cargo-fix[1]::
- Automatically fix lint warnings reported by rustc.
-
-man:cargo-run[1]::
- Run a binary or example of the local package.
-
-man:cargo-rustc[1]::
- Compile a package, and pass extra options to the compiler.
-
-man:cargo-rustdoc[1]::
- Build a package's documentation, using specified custom flags.
-
-man:cargo-test[1]::
- Execute unit and integration tests of a package.
-
-=== Manifest Commands
-
-man:cargo-generate-lockfile[1]::
- Generate `Cargo.lock` for a project.
-
-man:cargo-locate-project[1]::
- Print a JSON representation of a `Cargo.toml` file's location.
-
-man:cargo-metadata[1]::
- Output the resolved dependencies of a package, the concrete used versions
- including overrides, in machine-readable format.
-
-man:cargo-pkgid[1]::
- Print a fully qualified package specification.
-
-man:cargo-tree[1]::
- Display a tree visualization of a dependency graph.
-
-man:cargo-update[1]::
- Update dependencies as recorded in the local lock file.
-
-man:cargo-vendor[1]::
- Vendor all dependencies locally.
-
-man:cargo-verify-project[1]::
- Check correctness of crate manifest.
-
-=== Package Commands
-
-man:cargo-init[1]::
- Create a new Cargo package in an existing directory.
-
-man:cargo-install[1]::
- Build and install a Rust binary.
-
-man:cargo-new[1]::
- Create a new Cargo package.
-
-man:cargo-search[1]::
- Search packages in crates.io.
-
-man:cargo-uninstall[1]::
- Remove a Rust binary.
-
-=== Publishing Commands
-
-man:cargo-login[1]::
- Save an API token from the registry locally.
-
-man:cargo-owner[1]::
- Manage the owners of a crate on the registry.
-
-man:cargo-package[1]::
- Assemble the local package into a distributable tarball.
-
-man:cargo-publish[1]::
- Upload a package to the registry.
-
-man:cargo-yank[1]::
- Remove a pushed crate from the index.
-
-=== General Commands
-
-man:cargo-help[1]::
- Display help information about Cargo.
-
-man:cargo-version[1]::
- Show version information.
-
-== OPTIONS
-
-=== Special Options
-
-*-V*::
-*--version*::
- Print version info and exit. If used with `--verbose`, prints extra
- information.
-
-*--list*::
- List all installed Cargo subcommands. If used with `--verbose`, prints
- extra information.
-
-*--explain _CODE_*::
- Run `rustc --explain CODE` which will print out a detailed explanation of
- an error message (for example, `E0004`).
-
-=== Display Options
-
-include::options-display.adoc[]
-
-=== Manifest Options
-
-include::options-locked.adoc[]
-
-=== Common Options
-
-include::options-common.adoc[]
-
-include::section-environment.adoc[]
-
-include::section-exit-status.adoc[]
-
-== FILES
-
-`~/.cargo/`::
- Default location for Cargo's "home" directory where it stores various
- files. The location can be changed with the `CARGO_HOME` environment
- variable.
-
-`$CARGO_HOME/bin/`::
- Binaries installed by man:cargo-install[1] will be located here. If using
- rustup, executables distributed with Rust are also located here.
-
-`$CARGO_HOME/config.toml`::
- The global configuration file. See linkcargo:reference/config.html[the reference]
- for more information about configuration files.
-
-`.cargo/config.toml`::
- Cargo automatically searches for a file named `.cargo/config.toml` in the
- current directory, and all parent directories. These configuration files
- will be merged with the global configuration file.
-
-`$CARGO_HOME/credentials.toml`::
- Private authentication information for logging in to a registry.
-
-`$CARGO_HOME/registry/`::
- This directory contains cached downloads of the registry index and any
- downloaded dependencies.
-
-`$CARGO_HOME/git/`::
- This directory contains cached downloads of git dependencies.
-
-Please note that the internal structure of the `$CARGO_HOME` directory is not
-stable yet and may be subject to change.
-
-== EXAMPLES
-
-. Build a local package and all of its dependencies:
-
- cargo build
-
-. Build a package with optimizations:
-
- cargo build --release
-
-. Run tests for a cross-compiled target:
-
- cargo test --target i686-unknown-linux-gnu
-
-. Create a new package that builds an executable:
-
- cargo new foobar
-
-. Create a package in the current directory:
-
- mkdir foo && cd foo
- cargo init .
-
-. Learn about a command's options and usage:
-
- cargo help clean
-
-== BUGS
-
-See https://github.com/rust-lang/cargo/issues for issues.
-
-== SEE ALSO
-man:rustc[1], man:rustdoc[1]
diff --git a/src/doc/man/cargo.md b/src/doc/man/cargo.md
new file mode 100644
index 00000000000..901e1db02bc
--- /dev/null
+++ b/src/doc/man/cargo.md
@@ -0,0 +1,233 @@
+# cargo(1)
+
+## NAME
+
+cargo - The Rust package manager
+
+## SYNOPSIS
+
+`cargo` [_options_] _command_ [_args_]\
+`cargo` [_options_] `--version`\
+`cargo` [_options_] `--list`\
+`cargo` [_options_] `--help`\
+`cargo` [_options_] `--explain` _code_
+
+## DESCRIPTION
+
+This program is a package manager and build tool for the Rust language,
+available at .
+
+## COMMANDS
+
+### Build Commands
+
+{{man "cargo-bench" 1}}\
+ Execute benchmarks of a package.
+
+{{man "cargo-build" 1}}\
+ Compile a package.
+
+{{man "cargo-check" 1}}\
+ Check a local package and all of its dependencies for errors.
+
+{{man "cargo-clean" 1}}\
+ Remove artifacts that Cargo has generated in the past.
+
+{{man "cargo-doc" 1}}\
+ Build a package's documentation.
+
+{{man "cargo-fetch" 1}}\
+ Fetch dependencies of a package from the network.
+
+{{man "cargo-fix" 1}}\
+ Automatically fix lint warnings reported by rustc.
+
+{{man "cargo-run" 1}}\
+ Run a binary or example of the local package.
+
+{{man "cargo-rustc" 1}}\
+ Compile a package, and pass extra options to the compiler.
+
+{{man "cargo-rustdoc" 1}}\
+ Build a package's documentation, using specified custom flags.
+
+{{man "cargo-test" 1}}\
+ Execute unit and integration tests of a package.
+
+### Manifest Commands
+
+{{man "cargo-generate-lockfile" 1}}\
+ Generate `Cargo.lock` for a project.
+
+{{man "cargo-locate-project" 1}}\
+ Print a JSON representation of a `Cargo.toml` file's location.
+
+{{man "cargo-metadata" 1}}\
+ Output the resolved dependencies of a package in machine-readable format.
+
+{{man "cargo-pkgid" 1}}\
+ Print a fully qualified package specification.
+
+{{man "cargo-tree" 1}}\
+ Display a tree visualization of a dependency graph.
+
+{{man "cargo-update" 1}}\
+ Update dependencies as recorded in the local lock file.
+
+{{man "cargo-vendor" 1}}\
+ Vendor all dependencies locally.
+
+{{man "cargo-verify-project" 1}}\
+ Check correctness of crate manifest.
+
+### Package Commands
+
+{{man "cargo-init" 1}}\
+ Create a new Cargo package in an existing directory.
+
+{{man "cargo-install" 1}}\
+ Build and install a Rust binary.
+
+{{man "cargo-new" 1}}\
+ Create a new Cargo package.
+
+{{man "cargo-search" 1}}\
+ Search packages in crates.io.
+
+{{man "cargo-uninstall" 1}}\
+ Remove a Rust binary.
+
+### Publishing Commands
+
+{{man "cargo-login" 1}}\
+ Save an API token from the registry locally.
+
+{{man "cargo-owner" 1}}\
+ Manage the owners of a crate on the registry.
+
+{{man "cargo-package" 1}}\
+ Assemble the local package into a distributable tarball.
+
+{{man "cargo-publish" 1}}\
+ Upload a package to the registry.
+
+{{man "cargo-yank" 1}}\
+ Remove a pushed crate from the index.
+
+### General Commands
+
+{{man "cargo-help" 1}}\
+ Display help information about Cargo.
+
+{{man "cargo-version" 1}}\
+ Show version information.
+
+## OPTIONS
+
+### Special Options
+
+{{#options}}
+
+{{#option "`-V`" "`--version`" }}
+Print version info and exit. If used with `--verbose`, prints extra
+information.
+{{/option}}
+
+{{#option "`--list`" }}
+List all installed Cargo subcommands. If used with `--verbose`, prints extra
+information.
+{{/option}}
+
+{{#option "`--explain` _code_" }}
+Run `rustc --explain CODE` which will print out a detailed explanation of an
+error message (for example, `E0004`).
+{{/option}}
+
+{{/options}}
+
+### Display Options
+
+{{#options}}
+
+{{> options-display }}
+
+{{/options}}
+
+### Manifest Options
+
+{{#options}}
+{{> options-locked }}
+{{/options}}
+
+{{> section-options-common }}
+
+{{> section-environment }}
+
+{{> section-exit-status }}
+
+## FILES
+
+`~/.cargo/`\
+ Default location for Cargo's "home" directory where it
+stores various files. The location can be changed with the `CARGO_HOME`
+environment variable.
+
+`$CARGO_HOME/bin/`\
+ Binaries installed by {{man "cargo-install" 1}} will be located here. If using
+rustup, executables distributed with Rust are also located here.
+
+`$CARGO_HOME/config.toml`\
+ The global configuration file. See [the reference](../reference/config.html)
+for more information about configuration files.
+
+`.cargo/config.toml`\
+ Cargo automatically searches for a file named `.cargo/config.toml` in the
+current directory, and all parent directories. These configuration files
+will be merged with the global configuration file.
+
+`$CARGO_HOME/credentials.toml`\
+ Private authentication information for logging in to a registry.
+
+`$CARGO_HOME/registry/`\
+ This directory contains cached downloads of the registry index and any
+downloaded dependencies.
+
+`$CARGO_HOME/git/`\
+ This directory contains cached downloads of git dependencies.
+
+Please note that the internal structure of the `$CARGO_HOME` directory is not
+stable yet and may be subject to change.
+
+## EXAMPLES
+
+1. Build a local package and all of its dependencies:
+
+ cargo build
+
+2. Build a package with optimizations:
+
+ cargo build --release
+
+3. Run tests for a cross-compiled target:
+
+ cargo test --target i686-unknown-linux-gnu
+
+4. Create a new package that builds an executable:
+
+ cargo new foobar
+
+5. Create a package in the current directory:
+
+ mkdir foo && cd foo
+ cargo init .
+
+6. Learn about a command's options and usage:
+
+ cargo help clean
+
+## BUGS
+
+See for issues.
+
+## SEE ALSO
+{{man "rustc" 1}}, {{man "rustdoc" 1}}
diff --git a/src/doc/man/generated/cargo-bench.html b/src/doc/man/generated/cargo-bench.html
deleted file mode 100644
index 3085d4be2ef..00000000000
--- a/src/doc/man/generated/cargo-bench.html
+++ /dev/null
@@ -1,545 +0,0 @@
-NAME
-
-
cargo-bench - Execute benchmarks of a package
-
-
-
SYNOPSIS
-
-
-
cargo bench [OPTIONS ] [BENCHNAME] [-- BENCH-OPTIONS ]
-
-
-
-
-
DESCRIPTION
-
-
-
Compile and execute benchmarks.
-
-
-
The benchmark filtering argument BENCHNAME
and all the arguments following
-the two dashes (--
) are passed to the benchmark binaries and thus to
-libtest (rustc’s built in unit-test and micro-benchmarking framework). If
-you’re passing arguments to both Cargo and the binary, the ones after --
go
-to the binary, the ones before go to Cargo. For details about libtest’s
-arguments see the output of cargo bench -- --help
. As an example, this will
-run only the benchmark named foo
(and skip other similarly named benchmarks
-like foobar
):
-
-
-
-
cargo bench -- foo --exact
-
-
-
-
Benchmarks are built with the --test
option to rustc
which creates an
-executable with a main
function that automatically runs all functions
-annotated with the #[bench]
attribute. Cargo passes the --bench
flag to
-the test harness to tell it to run only benchmarks.
-
-
-
The libtest harness may be disabled by setting harness = false
in the target
-manifest settings, in which case your code will need to provide its own main
-function to handle running benchmarks.
-
-
-
-
-
-
OPTIONS
-
-
-
Benchmark Options
-
-
---no-run
-
-Compile, but don’t run benchmarks.
-
---no-fail-fast
-
-Run all benchmarks regardless of failure. Without this flag, Cargo will exit
-after the first executable fails. The Rust test harness will run all
-benchmarks within the executable to completion, this flag only applies to
-the executable as a whole.
-
-
-
-
-
-
Package Selection
-
-
By default, when no package selection options are given, the packages selected
-depend on the selected manifest file (based on the current working directory if
---manifest-path
is not given). If the manifest is the root of a workspace then
-the workspaces default members are selected, otherwise only the package defined
-by the manifest will be selected.
-
-
-
The default members of a workspace can be set explicitly with the
-workspace.default-members
key in the root manifest. If this is not set, a
-virtual workspace will include all workspace members (equivalent to passing
---workspace
), and a non-virtual workspace will include only the root crate itself.
-
-
-
--p SPEC …
---package SPEC …
-
-Benchmark only the specified packages. See cargo-pkgid(1) for the
-SPEC format. This flag may be specified multiple times.
-
---workspace
-
-Benchmark all members in the workspace.
-
---all
-
-Deprecated alias for --workspace
.
-
---exclude SPEC …
-
-Exclude the specified packages. Must be used in conjunction with the
---workspace
flag. This flag may be specified multiple times.
-
-
-
-
-
-
Target Selection
-
-
When no target selection options are given, cargo bench
will build the
-following targets of the selected packages:
-
-
-
-
The default behavior can be changed by setting the bench
flag for the target
-in the manifest settings. Setting examples to bench = true
will build and
-run the example as a benchmark. Setting targets to bench = false
will stop
-them from being benchmarked by default. Target selection options that take a
-target by name ignore the bench
flag and will always benchmark the given
-target.
-
-
-
Passing target selection flags will benchmark only the
-specified targets.
-
-
-
---lib
-
-Benchmark the package’s library.
-
---bin NAME …
-
-Benchmark the specified binary. This flag may be specified multiple times.
-
---bins
-
-Benchmark all binary targets.
-
---example NAME …
-
-Benchmark the specified example. This flag may be specified multiple times.
-
---examples
-
-Benchmark all example targets.
-
---test NAME …
-
-Benchmark the specified integration test. This flag may be specified multiple
-times.
-
---tests
-
-Benchmark all targets in test mode that have the test = true
manifest
-flag set. By default this includes the library and binaries built as
-unittests, and integration tests. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-unittest, and once as a dependency for binaries, integration tests, etc.).
-Targets may be enabled or disabled by setting the test
flag in the
-manifest settings for the target.
-
---bench NAME …
-
-Benchmark the specified benchmark. This flag may be specified multiple times.
-
---benches
-
-Benchmark all targets in benchmark mode that have the bench = true
-manifest flag set. By default this includes the library and binaries built
-as benchmarks, and bench targets. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-benchmark, and once as a dependency for binaries, benchmarks, etc.).
-Targets may be enabled or disabled by setting the bench
flag in the
-manifest settings for the target.
-
---all-targets
-
-Benchmark all targets. This is equivalent to specifying --lib --bins
---tests --benches --examples
.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Benchmark for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
-
-
-
-
-
Output Options
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
-
-
-
-
-
Display Options
-
-
By default the Rust test harness hides output from benchmark execution to keep
-results readable. Benchmark output can be recovered (e.g., for debugging) by
-passing --nocapture
to the benchmark binaries:
-
-
-
-
cargo bench -- --nocapture
-
-
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
---message-format FMT
-
-The output format for diagnostic messages. Can be specified multiple times
-and consists of comma-separated values. Valid values:
-
-
-
-human
(default): Display in a human-readable text format.
-
-
-short
: Emit shorter, human-readable text messages.
-
-
-json
: Emit JSON messages to stdout. See
-the reference
-for more details.
-
-
-json-diagnostic-short
: Ensure the rendered
field of JSON messages contains
-the "short" rendering from rustc.
-
-
-json-diagnostic-rendered-ansi
: Ensure the rendered
field of JSON messages
-contains embedded ANSI color codes for respecting rustc’s default color
-scheme.
-
-
-json-render-diagnostics
: Instruct Cargo to not include rustc diagnostics in
-in JSON messages printed, but instead Cargo itself should render the
-JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
-coming from rustc are still emitted.
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
Miscellaneous Options
-
-
The --jobs
argument affects the building of the benchmark executable but
-does not affect how many threads are used when running the benchmarks. The
-Rust test harness runs benchmarks serially in a single thread.
-
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
-
-
PROFILES
-
-
-
Profiles may be used to configure compiler options such as optimization levels
-and debug settings. See
-the reference
-for more details.
-
-
-
Benchmarks are always built with the bench
profile. Binary and lib targets
-are built separately as benchmarks with the bench
profile. Library targets
-are built with the release
profiles when linked to binaries and benchmarks.
-Dependencies use the release
profile.
-
-
-
If you need a debug build of a benchmark, try building it with
-cargo-build(1) which will use the test
profile which is by default
-unoptimized and includes debug information. You can then run the debug-enabled
-benchmark manually.
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Build and execute all the benchmarks of the current package:
-
-
-
-Run only a specific benchmark within a specific benchmark target:
-
-
-
cargo bench --bench bench_name -- modname::some_benchmark
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-build.html b/src/doc/man/generated/cargo-build.html
deleted file mode 100644
index 718dfd99740..00000000000
--- a/src/doc/man/generated/cargo-build.html
+++ /dev/null
@@ -1,494 +0,0 @@
-NAME
-
-
cargo-build - Compile the current package
-
-
-
-
DESCRIPTION
-
-
-
Compile local packages and all of their dependencies.
-
-
-
-
-
OPTIONS
-
-
-
Package Selection
-
-
By default, when no package selection options are given, the packages selected
-depend on the selected manifest file (based on the current working directory if
---manifest-path
is not given). If the manifest is the root of a workspace then
-the workspaces default members are selected, otherwise only the package defined
-by the manifest will be selected.
-
-
-
The default members of a workspace can be set explicitly with the
-workspace.default-members
key in the root manifest. If this is not set, a
-virtual workspace will include all workspace members (equivalent to passing
---workspace
), and a non-virtual workspace will include only the root crate itself.
-
-
-
--p SPEC …
---package SPEC …
-
-Build only the specified packages. See cargo-pkgid(1) for the
-SPEC format. This flag may be specified multiple times.
-
---workspace
-
-Build all members in the workspace.
-
---all
-
-Deprecated alias for --workspace
.
-
---exclude SPEC …
-
-Exclude the specified packages. Must be used in conjunction with the
---workspace
flag. This flag may be specified multiple times.
-
-
-
-
-
-
Target Selection
-
-
When no target selection options are given, cargo build
will build all
-binary and library targets of the selected packages. Binaries are skipped if
-they have required-features
that are missing.
-
-
-
Passing target selection flags will build only the
-specified targets.
-
-
-
---lib
-
-Build the package’s library.
-
---bin NAME …
-
-Build the specified binary. This flag may be specified multiple times.
-
---bins
-
-Build all binary targets.
-
---example NAME …
-
-Build the specified example. This flag may be specified multiple times.
-
---examples
-
-Build all example targets.
-
---test NAME …
-
-Build the specified integration test. This flag may be specified multiple
-times.
-
---tests
-
-Build all targets in test mode that have the test = true
manifest
-flag set. By default this includes the library and binaries built as
-unittests, and integration tests. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-unittest, and once as a dependency for binaries, integration tests, etc.).
-Targets may be enabled or disabled by setting the test
flag in the
-manifest settings for the target.
-
---bench NAME …
-
-Build the specified benchmark. This flag may be specified multiple times.
-
---benches
-
-Build all targets in benchmark mode that have the bench = true
-manifest flag set. By default this includes the library and binaries built
-as benchmarks, and bench targets. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-benchmark, and once as a dependency for binaries, benchmarks, etc.).
-Targets may be enabled or disabled by setting the bench
flag in the
-manifest settings for the target.
-
---all-targets
-
-Build all targets. This is equivalent to specifying --lib --bins
---tests --benches --examples
.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Build for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---release
-
-Build optimized artifacts with the release
profile. See the
-PROFILES section for details on how this affects profile selection.
-
-
-
-
-
-
Output Options
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
---out-dir DIRECTORY
-
-Copy final artifacts to this directory.
-
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
---message-format FMT
-
-The output format for diagnostic messages. Can be specified multiple times
-and consists of comma-separated values. Valid values:
-
-
-
-human
(default): Display in a human-readable text format.
-
-
-short
: Emit shorter, human-readable text messages.
-
-
-json
: Emit JSON messages to stdout. See
-the reference
-for more details.
-
-
-json-diagnostic-short
: Ensure the rendered
field of JSON messages contains
-the "short" rendering from rustc.
-
-
-json-diagnostic-rendered-ansi
: Ensure the rendered
field of JSON messages
-contains embedded ANSI color codes for respecting rustc’s default color
-scheme.
-
-
-json-render-diagnostics
: Instruct Cargo to not include rustc diagnostics in
-in JSON messages printed, but instead Cargo itself should render the
-JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
-coming from rustc are still emitted.
-
-
-
-
---build-plan
-
-Outputs a series of JSON messages to stdout that indicate the commands to
-run the build.
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
Miscellaneous Options
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
-
-
PROFILES
-
-
-
Profiles may be used to configure compiler options such as optimization levels
-and debug settings. See
-the reference
-for more details.
-
-
-
Profile selection depends on the target and crate being built. By default the
-dev
or test
profiles are used. If the --release
flag is given, then the
-release
or bench
profiles are used.
-
-
-
-
-
-
-
-
-
-Target
-Default Profile
---release
Profile
-
-
-
-
-lib, bin, example
-dev
-release
-
-
-test, bench, or any target
- in "test" or "bench" mode
-test
-bench
-
-
-
-
-
Dependencies use the dev
/release
profiles.
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Build the local package and all of its dependencies:
-
-
-
-Build with optimizations:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-check.html b/src/doc/man/generated/cargo-check.html
deleted file mode 100644
index e151265dc05..00000000000
--- a/src/doc/man/generated/cargo-check.html
+++ /dev/null
@@ -1,485 +0,0 @@
-NAME
-
-
cargo-check - Check the current package
-
-
-
-
DESCRIPTION
-
-
-
Check a local package and all of its dependencies for errors. This will
-essentially compile the packages without performing the final step of code
-generation, which is faster than running cargo build
. The compiler will save
-metadata files to disk so that future runs will reuse them if the source has
-not been modified.
-
-
-
-
-
OPTIONS
-
-
-
Package Selection
-
-
By default, when no package selection options are given, the packages selected
-depend on the selected manifest file (based on the current working directory if
---manifest-path
is not given). If the manifest is the root of a workspace then
-the workspaces default members are selected, otherwise only the package defined
-by the manifest will be selected.
-
-
-
The default members of a workspace can be set explicitly with the
-workspace.default-members
key in the root manifest. If this is not set, a
-virtual workspace will include all workspace members (equivalent to passing
---workspace
), and a non-virtual workspace will include only the root crate itself.
-
-
-
--p SPEC …
---package SPEC …
-
-Check only the specified packages. See cargo-pkgid(1) for the
-SPEC format. This flag may be specified multiple times.
-
---workspace
-
-Check all members in the workspace.
-
---all
-
-Deprecated alias for --workspace
.
-
---exclude SPEC …
-
-Exclude the specified packages. Must be used in conjunction with the
---workspace
flag. This flag may be specified multiple times.
-
-
-
-
-
-
Target Selection
-
-
When no target selection options are given, cargo check
will check all
-binary and library targets of the selected packages. Binaries are skipped if
-they have required-features
that are missing.
-
-
-
Passing target selection flags will check only the
-specified targets.
-
-
-
---lib
-
-Check the package’s library.
-
---bin NAME …
-
-Check the specified binary. This flag may be specified multiple times.
-
---bins
-
-Check all binary targets.
-
---example NAME …
-
-Check the specified example. This flag may be specified multiple times.
-
---examples
-
-Check all example targets.
-
---test NAME …
-
-Check the specified integration test. This flag may be specified multiple
-times.
-
---tests
-
-Check all targets in test mode that have the test = true
manifest
-flag set. By default this includes the library and binaries built as
-unittests, and integration tests. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-unittest, and once as a dependency for binaries, integration tests, etc.).
-Targets may be enabled or disabled by setting the test
flag in the
-manifest settings for the target.
-
---bench NAME …
-
-Check the specified benchmark. This flag may be specified multiple times.
-
---benches
-
-Check all targets in benchmark mode that have the bench = true
-manifest flag set. By default this includes the library and binaries built
-as benchmarks, and bench targets. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-benchmark, and once as a dependency for binaries, benchmarks, etc.).
-Targets may be enabled or disabled by setting the bench
flag in the
-manifest settings for the target.
-
---all-targets
-
-Check all targets. This is equivalent to specifying --lib --bins
---tests --benches --examples
.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Check for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---release
-
-Check optimized artifacts with the release
profile. See the
-PROFILES section for details on how this affects profile selection.
-
---profile NAME
-
-Changes check behavior. Currently only test
is
-supported, which will check with the
-#[cfg(test)]
attribute enabled. This is useful to have it
-check unit tests which are usually excluded via
-the cfg
attribute. This does not change the actual profile used.
-
-
-
-
-
-
Output Options
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
---message-format FMT
-
-The output format for diagnostic messages. Can be specified multiple times
-and consists of comma-separated values. Valid values:
-
-
-
-human
(default): Display in a human-readable text format.
-
-
-short
: Emit shorter, human-readable text messages.
-
-
-json
: Emit JSON messages to stdout. See
-the reference
-for more details.
-
-
-json-diagnostic-short
: Ensure the rendered
field of JSON messages contains
-the "short" rendering from rustc.
-
-
-json-diagnostic-rendered-ansi
: Ensure the rendered
field of JSON messages
-contains embedded ANSI color codes for respecting rustc’s default color
-scheme.
-
-
-json-render-diagnostics
: Instruct Cargo to not include rustc diagnostics in
-in JSON messages printed, but instead Cargo itself should render the
-JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
-coming from rustc are still emitted.
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
Miscellaneous Options
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
-
-
PROFILES
-
-
-
Profiles may be used to configure compiler options such as optimization levels
-and debug settings. See
-the reference
-for more details.
-
-
-
Profile selection depends on the target and crate being built. By default the
-dev
or test
profiles are used. If the --release
flag is given, then the
-release
or bench
profiles are used.
-
-
-
-
-
-
-
-
-
-Target
-Default Profile
---release
Profile
-
-
-
-
-lib, bin, example
-dev
-release
-
-
-test, bench, or any target
- in "test" or "bench" mode
-test
-bench
-
-
-
-
-
Dependencies use the dev
/release
profiles.
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Check the local package for errors:
-
-
-
-Check all targets, including unit tests:
-
-
-
cargo check --all-targets --profile=test
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-clean.html b/src/doc/man/generated/cargo-clean.html
deleted file mode 100644
index dbc1e4a367a..00000000000
--- a/src/doc/man/generated/cargo-clean.html
+++ /dev/null
@@ -1,254 +0,0 @@
-NAME
-
-
cargo-clean - Remove generated artifacts
-
-
-
-
DESCRIPTION
-
-
-
Remove artifacts from the target directory that Cargo has generated in the
-past.
-
-
-
With no options, cargo clean
will delete the entire target directory.
-
-
-
-
-
OPTIONS
-
-
-
Package Selection
-
-
When no packages are selected, all packages and all dependencies in the
-workspace are cleaned.
-
-
-
--p SPEC …
---package SPEC …
-
-Clean only the specified packages. This flag may be specified
-multiple times. See cargo-pkgid(1) for the SPEC format.
-
-
-
-
-
-
Clean Options
-
-
---doc
-
-This option will cause cargo clean
to remove only the doc
directory in
-the target directory.
-
---release
-
-Clean all artifacts that were built with the release
or bench
-profiles.
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
---target TRIPLE
-
-Clean for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Remove the entire target directory:
-
-
-
-Remove only the release artifacts:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-doc.html b/src/doc/man/generated/cargo-doc.html
deleted file mode 100644
index 33b6d6482ea..00000000000
--- a/src/doc/man/generated/cargo-doc.html
+++ /dev/null
@@ -1,448 +0,0 @@
-NAME
-
-
cargo-doc - Build a package's documentation
-
-
-
-
DESCRIPTION
-
-
-
Build the documentation for the local package and all dependencies. The output
-is placed in target/doc
in rustdoc’s usual format.
-
-
-
-
-
OPTIONS
-
-
-
Documentation 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.
-
---no-deps
-
-Do not build documentation for dependencies.
-
---document-private-items
-
-Include non-public items in the documentation.
-
-
-
-
-
-
Package Selection
-
-
By default, when no package selection options are given, the packages selected
-depend on the selected manifest file (based on the current working directory if
---manifest-path
is not given). If the manifest is the root of a workspace then
-the workspaces default members are selected, otherwise only the package defined
-by the manifest will be selected.
-
-
-
The default members of a workspace can be set explicitly with the
-workspace.default-members
key in the root manifest. If this is not set, a
-virtual workspace will include all workspace members (equivalent to passing
---workspace
), and a non-virtual workspace will include only the root crate itself.
-
-
-
--p SPEC …
---package SPEC …
-
-Document only the specified packages. See cargo-pkgid(1) for the
-SPEC format. This flag may be specified multiple times.
-
---workspace
-
-Document all members in the workspace.
-
---all
-
-Deprecated alias for --workspace
.
-
---exclude SPEC …
-
-Exclude the specified packages. Must be used in conjunction with the
---workspace
flag. This flag may be specified multiple times.
-
-
-
-
-
-
Target Selection
-
-
When no target selection options are given, cargo doc
will document all
-binary and library targets of the selected package. The binary will be skipped
-if its name is the same as the lib target. Binaries are skipped if they have
-required-features
that are missing.
-
-
-
The default behavior can be changed by setting doc = false
for the target in
-the manifest settings. Using target selection options will ignore the doc
-flag and will always document the given target.
-
-
-
---lib
-
-Document the package’s library.
-
---bin NAME …
-
-Document the specified binary. This flag may be specified multiple times.
-
---bins
-
-Document all binary targets.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Document for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---release
-
-Document optimized artifacts with the release
profile. See the
-PROFILES section for details on how this affects profile selection.
-
-
-
-
-
-
Output Options
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
---message-format FMT
-
-The output format for diagnostic messages. Can be specified multiple times
-and consists of comma-separated values. Valid values:
-
-
-
-human
(default): Display in a human-readable text format.
-
-
-short
: Emit shorter, human-readable text messages.
-
-
-json
: Emit JSON messages to stdout. See
-the reference
-for more details.
-
-
-json-diagnostic-short
: Ensure the rendered
field of JSON messages contains
-the "short" rendering from rustc.
-
-
-json-diagnostic-rendered-ansi
: Ensure the rendered
field of JSON messages
-contains embedded ANSI color codes for respecting rustc’s default color
-scheme.
-
-
-json-render-diagnostics
: Instruct Cargo to not include rustc diagnostics in
-in JSON messages printed, but instead Cargo itself should render the
-JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
-coming from rustc are still emitted.
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
Miscellaneous Options
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
-
-
PROFILES
-
-
-
Profiles may be used to configure compiler options such as optimization levels
-and debug settings. See
-the reference
-for more details.
-
-
-
Profile selection depends on the target and crate being built. By default the
-dev
or test
profiles are used. If the --release
flag is given, then the
-release
or bench
profiles are used.
-
-
-
-
-
-
-
-
-
-Target
-Default Profile
---release
Profile
-
-
-
-
-lib, bin, example
-dev
-release
-
-
-test, bench, or any target
- in "test" or "bench" mode
-test
-bench
-
-
-
-
-
Dependencies use the dev
/release
profiles.
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Build the local package documentation and its dependencies and output to
-target/doc
.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-fetch.html b/src/doc/man/generated/cargo-fetch.html
deleted file mode 100644
index d37eebd1c40..00000000000
--- a/src/doc/man/generated/cargo-fetch.html
+++ /dev/null
@@ -1,223 +0,0 @@
-NAME
-
-
cargo-fetch - Fetch dependencies of a package from the network
-
-
-
-
DESCRIPTION
-
-
-
If a Cargo.lock
file is available, this command will ensure that all of the
-git dependencies and/or registry dependencies are downloaded and locally
-available. Subsequent Cargo commands never touch the network after a cargo
-fetch
unless the lock file changes.
-
-
-
If the lock file is not available, then this command will generate the lock
-file before fetching the dependencies.
-
-
-
If --target
is not specified, then all target dependencies are fetched.
-
-
-
See also the cargo-prefetch
-plugin which adds a command to download popular crates. This may be useful if
-you plan to use Cargo without a network with the --offline
flag.
-
-
-
-
-
OPTIONS
-
-
-
Fetch options
-
-
---target TRIPLE
-
-Fetch for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Fetch all dependencies:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-fix.html b/src/doc/man/generated/cargo-fix.html
deleted file mode 100644
index 20d9bcc9d77..00000000000
--- a/src/doc/man/generated/cargo-fix.html
+++ /dev/null
@@ -1,569 +0,0 @@
-NAME
-
-
cargo-fix - Automatically fix lint warnings reported by rustc
-
-
-
-
DESCRIPTION
-
-
-
This Cargo subcommand will automatically take rustc’s suggestions from
-diagnostics like warnings and apply them to your source code. This is intended
-to help automate tasks that rustc itself already knows how to tell you to fix!
-The cargo fix
subcommand is also being developed for the Rust 2018 edition
-to provide code the ability to easily opt-in to the new edition without having
-to worry about any breakage.
-
-
-
Executing cargo fix
will under the hood execute cargo-check(1) . Any warnings
-applicable to your crate will be automatically fixed (if possible) and all
-remaining warnings will be displayed when the check process is finished. For
-example if you’d like to prepare for the 2018 edition, you can do so by
-executing:
-
-
-
-
which behaves the same as cargo check --all-targets
.
-
-
-
cargo fix
is only capable of fixing code that is normally compiled with
-cargo check
. If code is conditionally enabled with optional features, you
-will need to enable those features for that code to be analyzed:
-
-
-
-
cargo fix --edition --features foo
-
-
-
-
Similarly, other cfg
expressions like platform-specific code will need to
-pass --target
to fix code for the given target.
-
-
-
-
cargo fix --edition --target x86_64-pc-windows-gnu
-
-
-
-
If you encounter any problems with cargo fix
or otherwise have any questions
-or feature requests please don’t hesitate to file an issue at
-https://github.com/rust-lang/cargo
-
-
-
-
-
OPTIONS
-
-
-
Fix options
-
-
---broken-code
-
-Fix code even if it already has compiler errors. This is useful if cargo
-fix
fails to apply the changes. It will apply the changes and leave the
-broken code in the working directory for you to inspect and manually fix.
-
---edition
-
-Apply changes that will update the code to the latest edition. This will
-not update the edition in the Cargo.toml
manifest, which must be updated
-manually.
-
---edition-idioms
-
-Apply suggestions that will update code to the preferred style for the
-current edition.
-
---allow-no-vcs
-
-Fix code even if a VCS was not detected.
-
---allow-dirty
-
-Fix code even if the working directory has changes.
-
---allow-staged
-
-Fix code even if the working directory has staged changes.
-
-
-
-
-
-
Package Selection
-
-
By default, when no package selection options are given, the packages selected
-depend on the selected manifest file (based on the current working directory if
---manifest-path
is not given). If the manifest is the root of a workspace then
-the workspaces default members are selected, otherwise only the package defined
-by the manifest will be selected.
-
-
-
The default members of a workspace can be set explicitly with the
-workspace.default-members
key in the root manifest. If this is not set, a
-virtual workspace will include all workspace members (equivalent to passing
---workspace
), and a non-virtual workspace will include only the root crate itself.
-
-
-
--p SPEC …
---package SPEC …
-
-Fix only the specified packages. See cargo-pkgid(1) for the
-SPEC format. This flag may be specified multiple times.
-
---workspace
-
-Fix all members in the workspace.
-
---all
-
-Deprecated alias for --workspace
.
-
---exclude SPEC …
-
-Exclude the specified packages. Must be used in conjunction with the
---workspace
flag. This flag may be specified multiple times.
-
-
-
-
-
-
Target Selection
-
-
When no target selection options are given, cargo fix
will fix all targets
-(--all-targets
implied). Binaries are skipped if they have
-required-features
that are missing.
-
-
-
Passing target selection flags will fix only the
-specified targets.
-
-
-
---lib
-
-Fix the package’s library.
-
---bin NAME …
-
-Fix the specified binary. This flag may be specified multiple times.
-
---bins
-
-Fix all binary targets.
-
---example NAME …
-
-Fix the specified example. This flag may be specified multiple times.
-
---examples
-
-Fix all example targets.
-
---test NAME …
-
-Fix the specified integration test. This flag may be specified multiple
-times.
-
---tests
-
-Fix all targets in test mode that have the test = true
manifest
-flag set. By default this includes the library and binaries built as
-unittests, and integration tests. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-unittest, and once as a dependency for binaries, integration tests, etc.).
-Targets may be enabled or disabled by setting the test
flag in the
-manifest settings for the target.
-
---bench NAME …
-
-Fix the specified benchmark. This flag may be specified multiple times.
-
---benches
-
-Fix all targets in benchmark mode that have the bench = true
-manifest flag set. By default this includes the library and binaries built
-as benchmarks, and bench targets. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-benchmark, and once as a dependency for binaries, benchmarks, etc.).
-Targets may be enabled or disabled by setting the bench
flag in the
-manifest settings for the target.
-
---all-targets
-
-Fix all targets. This is equivalent to specifying --lib --bins
---tests --benches --examples
.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Fix for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---release
-
-Fix optimized artifacts with the release
profile. See the
-PROFILES section for details on how this affects profile selection.
-
---profile NAME
-
-Changes fix behavior. Currently only test
is
-supported, which will fix with the
-#[cfg(test)]
attribute enabled. This is useful to have it
-fix unit tests which are usually excluded via
-the cfg
attribute. This does not change the actual profile used.
-
-
-
-
-
-
Output Options
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
---message-format FMT
-
-The output format for diagnostic messages. Can be specified multiple times
-and consists of comma-separated values. Valid values:
-
-
-
-human
(default): Display in a human-readable text format.
-
-
-short
: Emit shorter, human-readable text messages.
-
-
-json
: Emit JSON messages to stdout. See
-the reference
-for more details.
-
-
-json-diagnostic-short
: Ensure the rendered
field of JSON messages contains
-the "short" rendering from rustc.
-
-
-json-diagnostic-rendered-ansi
: Ensure the rendered
field of JSON messages
-contains embedded ANSI color codes for respecting rustc’s default color
-scheme.
-
-
-json-render-diagnostics
: Instruct Cargo to not include rustc diagnostics in
-in JSON messages printed, but instead Cargo itself should render the
-JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
-coming from rustc are still emitted.
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
Miscellaneous Options
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
-
-
PROFILES
-
-
-
Profiles may be used to configure compiler options such as optimization levels
-and debug settings. See
-the reference
-for more details.
-
-
-
Profile selection depends on the target and crate being built. By default the
-dev
or test
profiles are used. If the --release
flag is given, then the
-release
or bench
profiles are used.
-
-
-
-
-
-
-
-
-
-Target
-Default Profile
---release
Profile
-
-
-
-
-lib, bin, example
-dev
-release
-
-
-test, bench, or any target
- in "test" or "bench" mode
-test
-bench
-
-
-
-
-
Dependencies use the dev
/release
profiles.
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Apply compiler suggestions to the local package:
-
-
-
-Convert a 2015 edition to 2018:
-
-
-
-Apply suggested idioms for the current edition:
-
-
-
cargo fix --edition-idioms
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-generate-lockfile.html b/src/doc/man/generated/cargo-generate-lockfile.html
deleted file mode 100644
index 467945a0aec..00000000000
--- a/src/doc/man/generated/cargo-generate-lockfile.html
+++ /dev/null
@@ -1,191 +0,0 @@
-NAME
-
-
cargo-generate-lockfile - Generate the lockfile for a package
-
-
-
SYNOPSIS
-
-
-
cargo generate-lockfile [OPTIONS ]
-
-
-
-
-
DESCRIPTION
-
-
-
This command will create the Cargo.lock
lockfile for the current package or
-workspace. If the lockfile already exists, it will be rebuilt if there are any
-manifest changes or dependency updates.
-
-
-
See also cargo-update(1) which is also capable of creating a Cargo.lock
-lockfile and has more options for controlling update behavior.
-
-
-
-
-
OPTIONS
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Create or update the lockfile for the current package or workspace:
-
-
-
cargo generate-lockfile
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-help.html b/src/doc/man/generated/cargo-help.html
deleted file mode 100644
index 0bdceebd1c9..00000000000
--- a/src/doc/man/generated/cargo-help.html
+++ /dev/null
@@ -1,53 +0,0 @@
-NAME
-
-
cargo-help - Get help for a Cargo command
-
-
-
SYNOPSIS
-
-
-
cargo help [SUBCOMMAND ]
-
-
-
-
-
DESCRIPTION
-
-
-
Prints a help message for the given command.
-
-
-
-
-
EXAMPLES
-
-
-
-
-Get help for a command:
-
-
-
-Help is also available with the --help
flag:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-init.html b/src/doc/man/generated/cargo-init.html
deleted file mode 100644
index 593596d34d7..00000000000
--- a/src/doc/man/generated/cargo-init.html
+++ /dev/null
@@ -1,263 +0,0 @@
-NAME
-
-
cargo-init - Create a new Cargo package in an existing directory
-
-
-
SYNOPSIS
-
-
-
cargo init [OPTIONS ] [PATH ]
-
-
-
-
-
DESCRIPTION
-
-
-
This command will create a new Cargo manifest in the current directory. Give a
-path as an argument to create in the given directory.
-
-
-
If there are typically-named Rust source files already in the directory, those
-will be used. If not, then a sample src/main.rs
file will be created, or
-src/lib.rs
if --lib
is passed.
-
-
-
If the directory is not already in a VCS repository, then a new repository
-is created (see --vcs
below).
-
-
-
The "authors" field in the manifest is determined from the environment or
-configuration settings. A name is required and is determined from (first match
-wins):
-
-
-
-
-cargo-new.name
Cargo config value
-
-
-CARGO_NAME
environment variable
-
-
-GIT_AUTHOR_NAME
environment variable
-
-
-GIT_COMMITTER_NAME
environment variable
-
-
-user.name
git configuration value
-
-
-USER
environment variable
-
-
-USERNAME
environment variable
-
-
-NAME
environment variable
-
-
-
-
-
The email address is optional and is determined from:
-
-
-
-
-cargo-new.email
Cargo config value
-
-
-CARGO_EMAIL
environment variable
-
-
-GIT_AUTHOR_EMAIL
environment variable
-
-
-GIT_COMMITTER_EMAIL
environment variable
-
-
-user.email
git configuration value
-
-
-EMAIL
environment variable
-
-
-
-
-
See the reference for more information about
-configuration files.
-
-
-
See cargo-new(1) for a similar command which will create a new package in
-a new directory.
-
-
-
-
-
OPTIONS
-
-
-
Init Options
-
-
---bin
-
-Create a package with a binary target (src/main.rs
).
-This is the default behavior.
-
---lib
-
-Create a package with a library target (src/lib.rs
).
-
---edition EDITION
-
-Specify the Rust edition to use. Default is 2018.
-Possible values: 2015, 2018
-
---name NAME
-
-Set the package name. Defaults to the directory name.
-
---vcs VCS
-
-Initialize a new VCS repository for the given version control system (git,
-hg, pijul, or fossil) or do not initialize any version control at all
-(none). If not specified, defaults to git
or the configuration value
-cargo-new.vcs
, or none
if already inside a VCS repository.
-
---registry REGISTRY
-
-This sets the publish
field in Cargo.toml
to the given registry name
-which will restrict publishing only to that registry.
-
-
Registry names are defined in Cargo config files .
-If not specified, the default registry defined by the registry.default
-config key is used. If the default registry is not set and --registry
is not
-used, the publish
field will not be set which means that publishing will not
-be restricted.
-
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Create a binary Cargo package in the current directory:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-install.html b/src/doc/man/generated/cargo-install.html
deleted file mode 100644
index 7093fa3e18b..00000000000
--- a/src/doc/man/generated/cargo-install.html
+++ /dev/null
@@ -1,461 +0,0 @@
-NAME
-
-
cargo-install - Build and install a Rust binary
-
-
-
SYNOPSIS
-
-
-
cargo install [OPTIONS ] CRATE …
-cargo install [OPTIONS ] --path PATH
-cargo install [OPTIONS ] --git URL [CRATE …]
-cargo install [OPTIONS ] --list
-
-
-
-
-
DESCRIPTION
-
-
-
This command manages Cargo’s local set of installed binary crates. Only
-packages which have executable [[bin]]
or [[example]]
targets can be
-installed, and all executables are installed into the installation root’s
-bin
folder.
-
-
-
The installation root is determined, in order of precedence:
-
-
-
-
---root
option
-
-
-CARGO_INSTALL_ROOT
environment variable
-
-
-install.root
Cargo config value
-
-
-CARGO_HOME
environment variable
-
-
-$HOME/.cargo
-
-
-
-
-
There are multiple sources from which a crate can be installed. The default
-location is crates.io but the --git
, --path
, and --registry
flags can
-change this source. If the source contains more than one package (such as
-crates.io or a git repository with multiple crates) the CRATE argument is
-required to indicate which crate should be installed.
-
-
-
Crates from crates.io can optionally specify the version they wish to install
-via the --version
flags, and similarly packages from git repositories can
-optionally specify the branch, tag, or revision that should be installed. If a
-crate has multiple binaries, the --bin
argument can selectively install only
-one of them, and if you’d rather install examples the --example
argument can
-be used as well.
-
-
-
If the package is already installed, Cargo will reinstall it if the installed
-version does not appear to be up-to-date. If any of the following values
-change, then Cargo will reinstall the package:
-
-
-
-
-The package version and source.
-
-
-The set of binary names installed.
-
-
-The chosen features.
-
-
-The release mode (--debug
).
-
-
-The target (--target
).
-
-
-
-
-
Installing with --path
will always build and install, unless there are
-conflicting binaries from another package. The --force
flag may be used to
-force Cargo to always reinstall the package.
-
-
-
If the source is crates.io or --git
then by default the crate will be built
-in a temporary target directory. To avoid this, the target directory can be
-specified by setting the CARGO_TARGET_DIR
environment variable to a relative
-path. In particular, this can be useful for caching build artifacts on
-continuous integration systems.
-
-
-
By default, the Cargo.lock
file that is included with the package will be
-ignored. This means that Cargo will recompute which versions of dependencies
-to use, possibly using newer versions that have been released since the
-package was published. The --locked
flag can be used to force Cargo to use
-the packaged Cargo.lock
file if it is available. This may be useful for
-ensuring reproducible builds, to use the exact same set of dependencies that
-were available when the package was published. It may also be useful if a
-newer version of a dependency is published that no longer builds on your
-system, or has other problems. The downside to using --locked
is that you
-will not receive any fixes or updates to any dependency. Note that Cargo did
-not start publishing Cargo.lock
files until version 1.37, which means
-packages published with prior versions will not have a Cargo.lock
file
-available.
-
-
-
-
-
OPTIONS
-
-
-
Install Options
-
-
---vers VERSION
---version VERSION
-
-Specify a version to install. This may be a
-version requirement , like
-~1.2
, to have Cargo select the newest version from the given
-requirement. If the version does not have a requirement operator (such as
-^
or ~
), then it must be in the form MAJOR.MINOR.PATCH , and will
-install exactly that version; it is not treated as a caret requirement
-like Cargo dependencies are.
-
---git URL
-
-Git URL to install the specified crate from.
-
---branch BRANCH
-
-Branch to use when installing from git.
-
---tag TAG
-
-Tag to use when installing from git.
-
---rev SHA
-
-Specific commit to use when installing from git.
-
---path PATH
-
-Filesystem path to local crate to install.
-
---list
-
-List all installed packages and their versions.
-
--f
---force
-
-Force overwriting existing crates or binaries. This can be used if a
-package has installed a binary with the same name as another package. This
-is also useful if something has changed on the system that you want to
-rebuild with, such as a newer version of rustc
.
-
---no-track
-
-By default, Cargo keeps track of the installed packages with a metadata
-file stored in the installation root directory. This flag tells Cargo not
-to use or create that file. With this flag, Cargo will refuse to overwrite
-any existing files unless the --force
flag is used. This also disables
-Cargo’s ability to protect against multiple concurrent invocations of
-Cargo installing at the same time.
-
---bin NAME …
-
-Install only the specified binary.
-
---bins
-
-Install all binaries.
-
---example NAME …
-
-Install only the specified example.
-
---examples
-
-Install all examples.
-
---root DIR
-
-Directory to install packages into.
-
---registry REGISTRY
-
-Name of the registry to use. Registry names are defined in Cargo config files .
-If not specified, the default registry is used, which is defined by the
-registry.default
config key which defaults to crates-io
.
-
---index INDEX
-
-The URL of the registry index to use.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Install for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
---debug
-
-Build with the dev
profile instead the release
profile.
-
-
-
-
-
-
Manifest Options
-
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Miscellaneous Options
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Install or upgrade a package from crates.io:
-
-
-
-Install or reinstall the package in the current directory:
-
-
-
cargo install --path .
-
-
-
-
-View the list of installed packages:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-locate-project.html b/src/doc/man/generated/cargo-locate-project.html
deleted file mode 100644
index 25f83cc91f6..00000000000
--- a/src/doc/man/generated/cargo-locate-project.html
+++ /dev/null
@@ -1,160 +0,0 @@
-NAME
-
-
cargo-locate-project - Print a JSON representation of a Cargo.toml file's location
-
-
-
SYNOPSIS
-
-
-
cargo locate-project [OPTIONS ]
-
-
-
-
-
DESCRIPTION
-
-
-
This command will print a JSON object to stdout with the full path to the
-Cargo.toml
manifest.
-
-
-
See also cargo-metadata(1) which is capable of returning the path to a
-workspace root.
-
-
-
-
-
OPTIONS
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Display the path to the manifest based on the current directory:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-login.html b/src/doc/man/generated/cargo-login.html
deleted file mode 100644
index 7037f025de8..00000000000
--- a/src/doc/man/generated/cargo-login.html
+++ /dev/null
@@ -1,168 +0,0 @@
-NAME
-
-
cargo-login - Save an API token from the registry locally
-
-
-
SYNOPSIS
-
-
-
cargo login [OPTIONS ] [TOKEN ]
-
-
-
-
-
DESCRIPTION
-
-
-
This command will save the API token to disk so that commands that require
-authentication, such as cargo-publish(1) , will be automatically
-authenticated. The token is saved in $CARGO_HOME/credentials.toml
. CARGO_HOME
-defaults to .cargo
in your home directory.
-
-
-
If the TOKEN argument is not specified, it will be read from stdin.
-
-
-
-
Take care to keep the token secret, it should not be shared with anyone else.
-
-
-
-
-
OPTIONS
-
-
-
Login Options
-
-
---registry REGISTRY
-
-Name of the registry to use. Registry names are defined in Cargo config files .
-If not specified, the default registry is used, which is defined by the
-registry.default
config key which defaults to crates-io
.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Save the API token to disk:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-metadata.html b/src/doc/man/generated/cargo-metadata.html
deleted file mode 100644
index 9a12c0591b0..00000000000
--- a/src/doc/man/generated/cargo-metadata.html
+++ /dev/null
@@ -1,520 +0,0 @@
-
-
-
cargo-metadata - Machine-readable metadata about the current package
-
-
-
-
-
-
cargo metadata [OPTIONS ]
-
-
-
-
-
-
-
-
Output JSON to stdout containing information about the workspace members and
-resolved dependencies of the current package.
-
-
-
It is recommended to include the --format-version
flag to future-proof
-your code to ensure the output is in the format you are expecting.
-
-
-
-
-
-
-
-
-
The output has the following format:
-
-
-
-
{
- /* Array of all packages in the workspace.
- It also includes all feature-enabled dependencies unless --no-deps is used.
- */
- "packages": [
- {
- /* The name of the package. */
- "name": "my-package",
- /* The version of the package. */
- "version": "0.1.0",
- /* The Package ID, a unique identifier for referring to the package. */
- "id": "my-package 0.1.0 (path+file:///path/to/my-package)",
- /* The license value from the manifest, or null. */
- "license": "MIT/Apache-2.0",
- /* The license-file value from the manifest, or null. */
- "license_file": "LICENSE",
- /* The description value from the manifest, or null. */
- "description": "Package description.",
- /* The source ID of the package. This represents where
- a package is retrieved from.
- This is null for path dependencies and workspace members.
- For other dependencies, it is a string with the format:
- - "registry+URL" for registry-based dependencies.
- Example: "registry+https://github.com/rust-lang/crates.io-index"
- - "git+URL" for git-based dependencies.
- Example: "git+https://github.com/rust-lang/cargo?rev=5e85ba14aaa20f8133863373404cb0af69eeef2c#5e85ba14aaa20f8133863373404cb0af69eeef2c"
- */
- "source": null,
- /* Array of dependencies declared in the package's manifest. */
- "dependencies": [
- {
- /* The name of the dependency. */
- "name": "bitflags",
- /* The source ID of the dependency. May be null, see
- description for the package source.
- */
- "source": "registry+https://github.com/rust-lang/crates.io-index",
- /* The version requirement for the dependency.
- Dependencies without a version requirement have a value of "*".
- */
- "req": "^1.0",
- /* The dependency kind.
- "dev", "build", or null for a normal dependency.
- */
- "kind": null,
- /* If the dependency is renamed, this is the new name for
- the dependency as a string. null if it is not renamed.
- */
- "rename": null,
- /* Boolean of whether or not this is an optional dependency. */
- "optional": false,
- /* Boolean of whether or not default features are enabled. */
- "uses_default_features": true,
- /* Array of features enabled. */
- "features": [],
- /* The target platform for the dependency.
- null if not a target dependency.
- */
- "target": "cfg(windows)",
- /* A string of the URL of the registry this dependency is from.
- If not specified or null, the dependency is from the default
- registry (crates.io).
- */
- "registry": null
- }
- ],
- /* Array of Cargo targets. */
- "targets": [
- {
- /* Array of target kinds.
- - lib targets list the `crate-type` values from the
- manifest such as "lib", "rlib", "dylib",
- "proc-macro", etc. (default ["lib"])
- - binary is ["bin"]
- - example is ["example"]
- - integration test is ["test"]
- - benchmark is ["bench"]
- - build script is ["custom-build"]
- */
- "kind": [
- "bin"
- ],
- /* Array of crate types.
- - lib and example libraries list the `crate-type` values
- from the manifest such as "lib", "rlib", "dylib",
- "proc-macro", etc. (default ["lib"])
- - all other target kinds are ["bin"]
- */
- "crate_types": [
- "bin"
- ],
- /* The name of the target. */
- "name": "my-package",
- /* Absolute path to the root source file of the target. */
- "src_path": "/path/to/my-package/src/main.rs",
- /* The Rust edition of the target.
- Defaults to the package edition.
- */
- "edition": "2018",
- /* Array of required features.
- This property is not included if no required features are set.
- */
- "required-features": ["feat1"],
- /* Whether or not this target has doc tests enabled, and
- the target is compatible with doc testing.
- */
- "doctest": false,
- /* Whether or not this target should be built and run with `--test`
- */
- "test": true
- }
- ],
- /* Set of features defined for the package.
- Each feature maps to an array of features or dependencies it
- enables.
- */
- "features": {
- "default": [
- "feat1"
- ],
- "feat1": [],
- "feat2": []
- },
- /* Absolute path to this package's manifest. */
- "manifest_path": "/path/to/my-package/Cargo.toml",
- /* Package metadata.
- This is null if no metadata is specified.
- */
- "metadata": {
- "docs": {
- "rs": {
- "all-features": true
- }
- }
- },
- /* List of registries to which this package may be published.
- Publishing is unrestricted if null, and forbidden if an empty array. */
- "publish": [
- "crates-io"
- ],
- /* Array of authors from the manifest.
- Empty array if no authors specified.
- */
- "authors": [
- "Jane Doe <user@example.com>"
- ],
- /* Array of categories from the manifest. */
- "categories": [
- "command-line-utilities"
- ],
- /* Array of keywords from the manifest. */
- "keywords": [
- "cli"
- ],
- /* The readme value from the manifest or null if not specified. */
- "readme": "README.md",
- /* The repository value from the manifest or null if not specified. */
- "repository": "https://github.com/rust-lang/cargo",
- /* The default edition of the package.
- Note that individual targets may have different editions.
- */
- "edition": "2018",
- /* Optional string that is the name of a native library the package
- is linking to.
- */
- "links": null,
- }
- ],
- /* Array of members of the workspace.
- Each entry is the Package ID for the package.
- */
- "workspace_members": [
- "my-package 0.1.0 (path+file:///path/to/my-package)",
- ],
- // The resolved dependency graph for the entire workspace. The enabled
- // features are based on the enabled features for the "current" package.
- // Inactivated optional dependencies are not listed.
- //
- // This is null if --no-deps is specified.
- //
- // By default, this includes all dependencies for all target platforms.
- // The `--filter-platform` flag may be used to narrow to a specific
- // target triple.
- "resolve": {
- /* Array of nodes within the dependency graph.
- Each node is a package.
- */
- "nodes": [
- {
- /* The Package ID of this node. */
- "id": "my-package 0.1.0 (path+file:///path/to/my-package)",
- /* The dependencies of this package, an array of Package IDs. */
- "dependencies": [
- "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)"
- ],
- /* The dependencies of this package. This is an alternative to
- "dependencies" which contains additional information. In
- particular, this handles renamed dependencies.
- */
- "deps": [
- {
- /* The name of the dependency's library target.
- If this is a renamed dependency, this is the new
- name.
- */
- "name": "bitflags",
- /* The Package ID of the dependency. */
- "pkg": "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- /* Array of dependency kinds. Added in Cargo 1.40. */
- "dep_kinds": [
- {
- /* The dependency kind.
- "dev", "build", or null for a normal dependency.
- */
- "kind": null,
- /* The target platform for the dependency.
- null if not a target dependency.
- */
- "target": "cfg(windows)"
- }
- ]
- }
- ],
- /* Array of features enabled on this package. */
- "features": [
- "default"
- ]
- }
- ],
- /* The root package of the workspace.
- This is null if this is a virtual workspace. Otherwise it is
- the Package ID of the root package.
- */
- "root": "my-package 0.1.0 (path+file:///path/to/my-package)"
- },
- /* The absolute path to the build directory where Cargo places its output. */
- "target_directory": "/path/to/my-package/target",
- /* The version of the schema for this metadata structure.
- This will be changed if incompatible changes are ever made.
- */
- "version": 1,
- /* The absolute path to the root of the workspace. */
- "workspace_root": "/path/to/my-package"
- /* Workspace metadata.
- This is null if no metadata is specified. */
- "metadata": {
- "docs": {
- "rs": {
- "all-features": true
- }
- }
- }
-}
-
-
-
-
-
-
-
-
-
-
-
---no-deps
-
-Output information only about the workspace members and don’t fetch
-dependencies.
-
---format-version VERSION
-
-Specify the version of the output format to use. Currently 1
is the only
-possible value.
-
---filter-platform TRIPLE
-
-This filters the resolve
output to only include dependencies for the
-given target triple. Without this flag, the resolve includes all targets.
-
-
Note that the dependencies listed in the "packages" array still includes all
-dependencies. Each package definition is intended to be an unaltered
-reproduction of the information within Cargo.toml
.
-
-
-
-
-
-
-
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
-
-
-
-
-Output JSON about the current package:
-
-
-
cargo metadata --format-version=1
-
-
-
-
-
-
-
-
diff --git a/src/doc/man/generated/cargo-new.html b/src/doc/man/generated/cargo-new.html
deleted file mode 100644
index 4ea179f9463..00000000000
--- a/src/doc/man/generated/cargo-new.html
+++ /dev/null
@@ -1,256 +0,0 @@
-NAME
-
-
cargo-new - Create a new Cargo package
-
-
-
SYNOPSIS
-
-
-
cargo new [OPTIONS ] PATH
-
-
-
-
-
DESCRIPTION
-
-
-
This command will create a new Cargo package in the given directory. This
-includes a simple template with a Cargo.toml
manifest, sample source file,
-and a VCS ignore file. If the directory is not already in a VCS repository,
-then a new repository is created (see --vcs
below).
-
-
-
The "authors" field in the manifest is determined from the environment or
-configuration settings. A name is required and is determined from (first match
-wins):
-
-
-
-
-cargo-new.name
Cargo config value
-
-
-CARGO_NAME
environment variable
-
-
-GIT_AUTHOR_NAME
environment variable
-
-
-GIT_COMMITTER_NAME
environment variable
-
-
-user.name
git configuration value
-
-
-USER
environment variable
-
-
-USERNAME
environment variable
-
-
-NAME
environment variable
-
-
-
-
-
The email address is optional and is determined from:
-
-
-
-
-cargo-new.email
Cargo config value
-
-
-CARGO_EMAIL
environment variable
-
-
-GIT_AUTHOR_EMAIL
environment variable
-
-
-GIT_COMMITTER_EMAIL
environment variable
-
-
-user.email
git configuration value
-
-
-EMAIL
environment variable
-
-
-
-
-
See the reference for more information about
-configuration files.
-
-
-
See cargo-init(1) for a similar command which will create a new manifest
-in an existing directory.
-
-
-
-
-
OPTIONS
-
-
-
New Options
-
-
---bin
-
-Create a package with a binary target (src/main.rs
).
-This is the default behavior.
-
---lib
-
-Create a package with a library target (src/lib.rs
).
-
---edition EDITION
-
-Specify the Rust edition to use. Default is 2018.
-Possible values: 2015, 2018
-
---name NAME
-
-Set the package name. Defaults to the directory name.
-
---vcs VCS
-
-Initialize a new VCS repository for the given version control system (git,
-hg, pijul, or fossil) or do not initialize any version control at all
-(none). If not specified, defaults to git
or the configuration value
-cargo-new.vcs
, or none
if already inside a VCS repository.
-
---registry REGISTRY
-
-This sets the publish
field in Cargo.toml
to the given registry name
-which will restrict publishing only to that registry.
-
-
Registry names are defined in Cargo config files .
-If not specified, the default registry defined by the registry.default
-config key is used. If the default registry is not set and --registry
is not
-used, the publish
field will not be set which means that publishing will not
-be restricted.
-
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Create a binary Cargo package in the given directory:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-owner.html b/src/doc/man/generated/cargo-owner.html
deleted file mode 100644
index c7fb23f7163..00000000000
--- a/src/doc/man/generated/cargo-owner.html
+++ /dev/null
@@ -1,220 +0,0 @@
-NAME
-
-
cargo-owner - Manage the owners of a crate on the registry
-
-
-
SYNOPSIS
-
-
-
cargo owner [OPTIONS ] --add LOGIN [CRATE ]
-cargo owner [OPTIONS ] --remove LOGIN [CRATE ]
-cargo owner [OPTIONS ] --list [CRATE ]
-
-
-
-
-
DESCRIPTION
-
-
-
This command will modify the owners for a crate on the registry. Owners of a
-crate can upload new versions and yank old versions. Non-team owners can also
-modify the set of owners, so take care!
-
-
-
This command requires you to be authenticated with either the --token
option
-or using cargo-login(1) .
-
-
-
If the crate name is not specified, it will use the package name from the
-current directory.
-
-
-
See the reference for more
-information about owners and publishing.
-
-
-
-
-
OPTIONS
-
-
-
Owner Options
-
-
--a
---add LOGIN …
-
-Invite the given user or team as an owner.
-
--r
---remove LOGIN …
-
-Remove the given user or team as an owner.
-
--l
---list
-
-List owners of a crate.
-
---token TOKEN
-
-API token to use when authenticating. This overrides the token stored in
-the credentials file (which is created by cargo-login(1) ).
-
-
Cargo config environment variables can be
-used to override the tokens stored in the credentials file. The token for
-crates.io may be specified with the CARGO_REGISTRY_TOKEN
environment
-variable. Tokens for other registries may be specified with environment
-variables of the form CARGO_REGISTRIES_NAME_TOKEN
where NAME
is the name
-of the registry in all capital letters.
-
-
---index INDEX
-
-The URL of the registry index to use.
-
---registry REGISTRY
-
-Name of the registry to use. Registry names are defined in Cargo config files .
-If not specified, the default registry is used, which is defined by the
-registry.default
config key which defaults to crates-io
.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-List owners of a package:
-
-
-
cargo owner --list foo
-
-
-
-
-Invite an owner to a package:
-
-
-
cargo owner --add username foo
-
-
-
-
-Remove an owner from a package:
-
-
-
cargo owner --remove username foo
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-package.html b/src/doc/man/generated/cargo-package.html
deleted file mode 100644
index 091b6e36006..00000000000
--- a/src/doc/man/generated/cargo-package.html
+++ /dev/null
@@ -1,354 +0,0 @@
-NAME
-
-
cargo-package - Assemble the local package into a distributable tarball
-
-
-
SYNOPSIS
-
-
-
cargo package [OPTIONS ]
-
-
-
-
-
DESCRIPTION
-
-
-
This command will create a distributable, compressed .crate
file with the
-source code of the package in the current directory. The resulting file will
-be stored in the target/package
directory. This performs the following
-steps:
-
-
-
-
-Load and check the current workspace, performing some basic checks.
-
-
-
-Create the compressed .crate
file.
-
-
-
-The original Cargo.toml
file is rewritten and normalized.
-
-
-[patch]
, [replace]
, and [workspace]
sections are removed from the
-manifest.
-
-
-Cargo.lock
is automatically included if the package contains an
-executable binary or example target. cargo-install(1) will use the
-packaged lock file if the --locked
flag is used.
-
-
-A .cargo_vcs_info.json
file is included that contains information
-about the current VCS checkout hash if available (not included with
---allow-dirty
).
-
-
-
-
-
-Extract the .crate
file and build it to verify it can build.
-
-
-
-Check that build scripts did not modify any source files.
-
-
-
-
-
The list of files included can be controlled with the include
and exclude
-fields in the manifest.
-
-
-
See the reference for more details about
-packaging and publishing.
-
-
-
-
-
OPTIONS
-
-
-
Package Options
-
-
--l
---list
-
-Print files included in a package without making one.
-
---no-verify
-
-Don’t verify the contents by building them.
-
---no-metadata
-
-Ignore warnings about a lack of human-usable metadata (such as the
-description or the license).
-
---allow-dirty
-
-Allow working directories with uncommitted VCS changes to be packaged.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Package for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Miscellaneous Options
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Create a compressed .crate
file of the current package:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-pkgid.html b/src/doc/man/generated/cargo-pkgid.html
deleted file mode 100644
index b1ab862d86a..00000000000
--- a/src/doc/man/generated/cargo-pkgid.html
+++ /dev/null
@@ -1,266 +0,0 @@
-NAME
-
-
cargo-pkgid - Print a fully qualified package specification
-
-
-
SYNOPSIS
-
-
-
cargo pkgid [OPTIONS ] [SPEC ]
-
-
-
-
-
DESCRIPTION
-
-
-
Given a SPEC argument, print out the fully qualified package ID specifier
-for a package or dependency in the current workspace. This command will
-generate an error if SPEC is ambiguous as to which package it refers to in
-the dependency graph. If no SPEC is given, then the specifier for the local
-package is printed.
-
-
-
This command requires that a lockfile is available and dependencies have been
-fetched.
-
-
-
A package specifier consists of a name, version, and source URL. You are
-allowed to use partial specifiers to succinctly match a specific package as
-long as it matches only one package. The format of a SPEC can be one of the
-following:
-
-
-Table 1. SPEC Query Format
-
-
-
-
-
-
-SPEC Structure
-Example SPEC
-
-
-
-
-NAME
-bitflags
-
-
-NAME :
VERSION
-bitflags:1.0.4
-
-
-URL
-https://github.com/rust-lang/cargo
-
-
-URL #
VERSION
-https://github.com/rust-lang/cargo#0.33.0
-
-
-URL #
NAME
-https://github.com/rust-lang/crates.io-index#bitflags
-
-
-URL #
NAME :
VERSION
-https://github.com/rust-lang/cargo#crates-io:0.21.0
-
-
-
-
-
-
-
OPTIONS
-
-
-
Package Selection
-
-
--p SPEC
---package SPEC
-
-Get the package ID for the given package instead of the current package.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Retrieve package specification for foo
package:
-
-
-
-Retrieve package specification for version 1.0.0 of foo
:
-
-
-
-Retrieve package specification for foo
from crates.io:
-
-
-
cargo pkgid https://github.com/rust-lang/crates.io-index#foo
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-publish.html b/src/doc/man/generated/cargo-publish.html
deleted file mode 100644
index 04715c65106..00000000000
--- a/src/doc/man/generated/cargo-publish.html
+++ /dev/null
@@ -1,338 +0,0 @@
-NAME
-
-
cargo-publish - Upload a package to the registry
-
-
-
SYNOPSIS
-
-
-
cargo publish [OPTIONS ]
-
-
-
-
-
DESCRIPTION
-
-
-
This command will create a distributable, compressed .crate
file with the
-source code of the package in the current directory and upload it to a
-registry. The default registry is https://crates.io . This performs the
-following steps:
-
-
-
-
-Performs a few checks, including:
-
-
-
-Create a .crate
file by following the steps in cargo-package(1) .
-
-
-Upload the crate to the registry. Note that the server will perform
-additional checks on the crate.
-
-
-
-
-
This command requires you to be authenticated with either the --token
option
-or using cargo-login(1) .
-
-
-
See the reference for more details about
-packaging and publishing.
-
-
-
-
-
OPTIONS
-
-
-
Publish Options
-
-
---dry-run
-
-Perform all checks without uploading.
-
---token TOKEN
-
-API token to use when authenticating. This overrides the token stored in
-the credentials file (which is created by cargo-login(1) ).
-
-
Cargo config environment variables can be
-used to override the tokens stored in the credentials file. The token for
-crates.io may be specified with the CARGO_REGISTRY_TOKEN
environment
-variable. Tokens for other registries may be specified with environment
-variables of the form CARGO_REGISTRIES_NAME_TOKEN
where NAME
is the name
-of the registry in all capital letters.
-
-
---no-verify
-
-Don’t verify the contents by building them.
-
---allow-dirty
-
-Allow working directories with uncommitted VCS changes to be packaged.
-
---index INDEX
-
-The URL of the registry index to use.
-
---registry REGISTRY
-
-Name of the registry to use. Registry names are defined in Cargo config files .
-If not specified, the default registry is used, which is defined by the
-registry.default
config key which defaults to crates-io
.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Publish for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Miscellaneous Options
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Publish the current package:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-run.html b/src/doc/man/generated/cargo-run.html
deleted file mode 100644
index c2cc8a61a66..00000000000
--- a/src/doc/man/generated/cargo-run.html
+++ /dev/null
@@ -1,407 +0,0 @@
-NAME
-
-
cargo-run - Run the current package
-
-
-
SYNOPSIS
-
-
-
cargo run [OPTIONS ] [-- ARGS ]
-
-
-
-
-
DESCRIPTION
-
-
-
Run a binary or example of the local package.
-
-
-
All the arguments following the two dashes (--
) are passed to the binary to
-run. If you’re passing arguments to both Cargo and the binary, the ones after
---
go to the binary, the ones before go to Cargo.
-
-
-
-
-
OPTIONS
-
-
-
Package Selection
-
-
By default, the package in the current working directory is selected. The -p
-flag can be used to choose a different package in a workspace.
-
-
-
--p SPEC
---package SPEC
-
-The package to run. See cargo-pkgid(1) for
-the SPEC format.
-
-
-
-
-
-
Target Selection
-
-
When no target selection options are given, cargo run
will run the binary
-target. If there are multiple binary targets, you must pass a target flag to
-choose one. Or, the default-run
field may be specified in the [package]
-section of Cargo.toml
to choose the name of the binary to run by default.
-
-
-
---bin NAME
-
-Run the specified binary.
-
---example NAME
-
-Run the specified example.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Run for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---release
-
-Run optimized artifacts with the release
profile. See the
-PROFILES section for details on how this affects profile selection.
-
-
-
-
-
-
Output Options
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
---message-format FMT
-
-The output format for diagnostic messages. Can be specified multiple times
-and consists of comma-separated values. Valid values:
-
-
-
-human
(default): Display in a human-readable text format.
-
-
-short
: Emit shorter, human-readable text messages.
-
-
-json
: Emit JSON messages to stdout. See
-the reference
-for more details.
-
-
-json-diagnostic-short
: Ensure the rendered
field of JSON messages contains
-the "short" rendering from rustc.
-
-
-json-diagnostic-rendered-ansi
: Ensure the rendered
field of JSON messages
-contains embedded ANSI color codes for respecting rustc’s default color
-scheme.
-
-
-json-render-diagnostics
: Instruct Cargo to not include rustc diagnostics in
-in JSON messages printed, but instead Cargo itself should render the
-JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
-coming from rustc are still emitted.
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
Miscellaneous Options
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
-
-
PROFILES
-
-
-
Profiles may be used to configure compiler options such as optimization levels
-and debug settings. See
-the reference
-for more details.
-
-
-
Profile selection depends on the target and crate being built. By default the
-dev
or test
profiles are used. If the --release
flag is given, then the
-release
or bench
profiles are used.
-
-
-
-
-
-
-
-
-
-Target
-Default Profile
---release
Profile
-
-
-
-
-lib, bin, example
-dev
-release
-
-
-test, bench, or any target
- in "test" or "bench" mode
-test
-bench
-
-
-
-
-
Dependencies use the dev
/release
profiles.
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Build the local package and run its main target (assuming only one binary):
-
-
-
-Run an example with extra arguments:
-
-
-
cargo run --example exname -- --exoption exarg1 exarg2
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-rustc.html b/src/doc/man/generated/cargo-rustc.html
deleted file mode 100644
index 5957b518ea8..00000000000
--- a/src/doc/man/generated/cargo-rustc.html
+++ /dev/null
@@ -1,469 +0,0 @@
-NAME
-
-
cargo-rustc - Compile the current package, and pass extra options to the compiler
-
-
-
SYNOPSIS
-
-
-
cargo rustc [OPTIONS ] [-- ARGS ]
-
-
-
-
-
DESCRIPTION
-
-
-
The specified target for the current package (or package specified by -p
if
-provided) will be compiled along with all of its dependencies. The specified
-ARGS will all be passed to the final compiler invocation, not any of the
-dependencies. Note that the compiler will still unconditionally receive
-arguments such as -L
, --extern
, and --crate-type
, and the specified
-ARGS will simply be added to the compiler invocation.
-
-
-
-
This command requires that only one target is being compiled when additional
-arguments are provided. If more than one target is available for the current
-package the filters of --lib
, --bin
, etc, must be used to select which
-target is compiled.
-To pass flags to all compiler processes spawned by Cargo, use the RUSTFLAGS
-environment variable or the
-build.rustflags
config value .
-
-
-
-
-
OPTIONS
-
-
-
Package Selection
-
-
By default, the package in the current working directory is selected. The -p
-flag can be used to choose a different package in a workspace.
-
-
-
--p SPEC
---package SPEC
-
-The package to build. See cargo-pkgid(1) for
-the SPEC format.
-
-
-
-
-
-
Target Selection
-
-
When no target selection options are given, cargo rustc
will build all
-binary and library targets of the selected package.
-
-
-
Passing target selection flags will build only the
-specified targets.
-
-
-
---lib
-
-Build the package’s library.
-
---bin NAME …
-
-Build the specified binary. This flag may be specified multiple times.
-
---bins
-
-Build all binary targets.
-
---example NAME …
-
-Build the specified example. This flag may be specified multiple times.
-
---examples
-
-Build all example targets.
-
---test NAME …
-
-Build the specified integration test. This flag may be specified multiple
-times.
-
---tests
-
-Build all targets in test mode that have the test = true
manifest
-flag set. By default this includes the library and binaries built as
-unittests, and integration tests. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-unittest, and once as a dependency for binaries, integration tests, etc.).
-Targets may be enabled or disabled by setting the test
flag in the
-manifest settings for the target.
-
---bench NAME …
-
-Build the specified benchmark. This flag may be specified multiple times.
-
---benches
-
-Build all targets in benchmark mode that have the bench = true
-manifest flag set. By default this includes the library and binaries built
-as benchmarks, and bench targets. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-benchmark, and once as a dependency for binaries, benchmarks, etc.).
-Targets may be enabled or disabled by setting the bench
flag in the
-manifest settings for the target.
-
---all-targets
-
-Build all targets. This is equivalent to specifying --lib --bins
---tests --benches --examples
.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Build for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---release
-
-Build optimized artifacts with the release
profile. See the
-PROFILES section for details on how this affects profile selection.
-
-
-
-
-
-
Output Options
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
---message-format FMT
-
-The output format for diagnostic messages. Can be specified multiple times
-and consists of comma-separated values. Valid values:
-
-
-
-human
(default): Display in a human-readable text format.
-
-
-short
: Emit shorter, human-readable text messages.
-
-
-json
: Emit JSON messages to stdout. See
-the reference
-for more details.
-
-
-json-diagnostic-short
: Ensure the rendered
field of JSON messages contains
-the "short" rendering from rustc.
-
-
-json-diagnostic-rendered-ansi
: Ensure the rendered
field of JSON messages
-contains embedded ANSI color codes for respecting rustc’s default color
-scheme.
-
-
-json-render-diagnostics
: Instruct Cargo to not include rustc diagnostics in
-in JSON messages printed, but instead Cargo itself should render the
-JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
-coming from rustc are still emitted.
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
Miscellaneous Options
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
-
-
PROFILES
-
-
-
Profiles may be used to configure compiler options such as optimization levels
-and debug settings. See
-the reference
-for more details.
-
-
-
Profile selection depends on the target and crate being built. By default the
-dev
or test
profiles are used. If the --release
flag is given, then the
-release
or bench
profiles are used.
-
-
-
-
-
-
-
-
-
-Target
-Default Profile
---release
Profile
-
-
-
-
-lib, bin, example
-dev
-release
-
-
-test, bench, or any target
- in "test" or "bench" mode
-test
-bench
-
-
-
-
-
Dependencies use the dev
/release
profiles.
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Check if your package (not including dependencies) uses unsafe code:
-
-
-
cargo rustc --lib -- -D unsafe-code
-
-
-
-
-Try an experimental flag on the nightly compiler, such as this which prints
-the size of every type:
-
-
-
cargo rustc --lib -- -Z print-type-sizes
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-rustdoc.html b/src/doc/man/generated/cargo-rustdoc.html
deleted file mode 100644
index c4673dda770..00000000000
--- a/src/doc/man/generated/cargo-rustdoc.html
+++ /dev/null
@@ -1,475 +0,0 @@
-NAME
-
-
cargo-rustdoc - Build a package's documentation, using specified custom flags
-
-
-
SYNOPSIS
-
-
-
cargo rustdoc [OPTIONS ] [-- ARGS ]
-
-
-
-
-
DESCRIPTION
-
-
-
The specified target for the current package (or package specified by -p
if
-provided) will be documented with the specified ARGS being passed to the
-final rustdoc invocation. Dependencies will not be documented as part of this
-command. Note that rustdoc will still unconditionally receive arguments such
-as -L
, --extern
, and --crate-type
, and the specified ARGS will simply
-be added to the rustdoc invocation.
-
-
-
-
This command requires that only one target is being compiled when additional
-arguments are provided. If more than one target is available for the current
-package the filters of --lib
, --bin
, etc, must be used to select which
-target is compiled.
-To pass flags to all rustdoc processes spawned by Cargo, use the
-RUSTDOCFLAGS
environment variable
-or the build.rustdocflags
config value .
-
-
-
-
-
OPTIONS
-
-
-
Documentation 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.
-
-
-
-
-
-
Package Selection
-
-
By default, the package in the current working directory is selected. The -p
-flag can be used to choose a different package in a workspace.
-
-
-
--p SPEC
---package SPEC
-
-The package to document. See cargo-pkgid(1) for
-the SPEC format.
-
-
-
-
-
-
Target Selection
-
-
When no target selection options are given, cargo rustdoc
will document all
-binary and library targets of the selected package. The binary will be skipped
-if its name is the same as the lib target. Binaries are skipped if they have
-required-features
that are missing.
-
-
-
Passing target selection flags will document only the
-specified targets.
-
-
-
---lib
-
-Document the package’s library.
-
---bin NAME …
-
-Document the specified binary. This flag may be specified multiple times.
-
---bins
-
-Document all binary targets.
-
---example NAME …
-
-Document the specified example. This flag may be specified multiple times.
-
---examples
-
-Document all example targets.
-
---test NAME …
-
-Document the specified integration test. This flag may be specified multiple
-times.
-
---tests
-
-Document all targets in test mode that have the test = true
manifest
-flag set. By default this includes the library and binaries built as
-unittests, and integration tests. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-unittest, and once as a dependency for binaries, integration tests, etc.).
-Targets may be enabled or disabled by setting the test
flag in the
-manifest settings for the target.
-
---bench NAME …
-
-Document the specified benchmark. This flag may be specified multiple times.
-
---benches
-
-Document all targets in benchmark mode that have the bench = true
-manifest flag set. By default this includes the library and binaries built
-as benchmarks, and bench targets. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-benchmark, and once as a dependency for binaries, benchmarks, etc.).
-Targets may be enabled or disabled by setting the bench
flag in the
-manifest settings for the target.
-
---all-targets
-
-Document all targets. This is equivalent to specifying --lib --bins
---tests --benches --examples
.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Document for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---release
-
-Document optimized artifacts with the release
profile. See the
-PROFILES section for details on how this affects profile selection.
-
-
-
-
-
-
Output Options
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
---message-format FMT
-
-The output format for diagnostic messages. Can be specified multiple times
-and consists of comma-separated values. Valid values:
-
-
-
-human
(default): Display in a human-readable text format.
-
-
-short
: Emit shorter, human-readable text messages.
-
-
-json
: Emit JSON messages to stdout. See
-the reference
-for more details.
-
-
-json-diagnostic-short
: Ensure the rendered
field of JSON messages contains
-the "short" rendering from rustc.
-
-
-json-diagnostic-rendered-ansi
: Ensure the rendered
field of JSON messages
-contains embedded ANSI color codes for respecting rustc’s default color
-scheme.
-
-
-json-render-diagnostics
: Instruct Cargo to not include rustc diagnostics in
-in JSON messages printed, but instead Cargo itself should render the
-JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
-coming from rustc are still emitted.
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
Miscellaneous Options
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
-
-
PROFILES
-
-
-
Profiles may be used to configure compiler options such as optimization levels
-and debug settings. See
-the reference
-for more details.
-
-
-
Profile selection depends on the target and crate being built. By default the
-dev
or test
profiles are used. If the --release
flag is given, then the
-release
or bench
profiles are used.
-
-
-
-
-
-
-
-
-
-Target
-Default Profile
---release
Profile
-
-
-
-
-lib, bin, example
-dev
-release
-
-
-test, bench, or any target
- in "test" or "bench" mode
-test
-bench
-
-
-
-
-
Dependencies use the dev
/release
profiles.
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Build documentation with custom CSS included from a given file:
-
-
-
cargo rustdoc --lib -- --extend-css extra.css
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-search.html b/src/doc/man/generated/cargo-search.html
deleted file mode 100644
index 9f33fa22546..00000000000
--- a/src/doc/man/generated/cargo-search.html
+++ /dev/null
@@ -1,166 +0,0 @@
-NAME
-
-
cargo-search - Search packages in crates.io
-
-
-
SYNOPSIS
-
-
-
cargo search [OPTIONS ] [QUERY …]
-
-
-
-
-
DESCRIPTION
-
-
-
This performs a textual search for crates on https://crates.io . The matching
-crates will be displayed along with their description in TOML format suitable
-for copying into a Cargo.toml
manifest.
-
-
-
-
-
OPTIONS
-
-
-
Search Options
-
-
---limit LIMIT
-
-Limit the number of results (default: 10, max: 100).
-
---index INDEX
-
-The URL of the registry index to use.
-
---registry REGISTRY
-
-Name of the registry to use. Registry names are defined in Cargo config files .
-If not specified, the default registry is used, which is defined by the
-registry.default
config key which defaults to crates-io
.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Search for a package from crates.io:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-test.html b/src/doc/man/generated/cargo-test.html
deleted file mode 100644
index ee87f3cba85..00000000000
--- a/src/doc/man/generated/cargo-test.html
+++ /dev/null
@@ -1,613 +0,0 @@
-NAME
-
-
cargo-test - Execute unit and integration tests of a package
-
-
-
SYNOPSIS
-
-
-
cargo test [OPTIONS ] [TESTNAME] [-- TEST-OPTIONS ]
-
-
-
-
-
DESCRIPTION
-
-
-
Compile and execute unit and integration tests.
-
-
-
The test filtering argument TESTNAME
and all the arguments following the two
-dashes (--
) are passed to the test binaries and thus to libtest (rustc’s
-built in unit-test and micro-benchmarking framework). If you’re passing
-arguments to both Cargo and the binary, the ones after --
go to the binary,
-the ones before go to Cargo. For details about libtest’s arguments see the
-output of cargo test -- --help
.
-
-
-
As an example, this will filter for tests with foo
in their name and run them
-on 3 threads in parallel:
-
-
-
-
cargo test foo -- --test-threads 3
-
-
-
-
Tests are built with the --test
option to rustc
which creates an
-executable with a main
function that automatically runs all functions
-annotated with the #[test]
attribute in multiple threads. #[bench]
-annotated functions will also be run with one iteration to verify that they
-are functional.
-
-
-
The libtest harness may be disabled by setting harness = false
in the target
-manifest settings, in which case your code will need to provide its own main
-function to handle running tests.
-
-
-
Documentation tests are also run by default, which is handled by rustdoc
. It
-extracts code samples from documentation comments and executes them. See the
-rustdoc book for more information on
-writing doc tests.
-
-
-
-
-
OPTIONS
-
-
-
Test Options
-
-
---no-run
-
-Compile, but don’t run tests.
-
---no-fail-fast
-
-Run all tests regardless of failure. Without this flag, Cargo will exit
-after the first executable fails. The Rust test harness will run all
-tests within the executable to completion, this flag only applies to
-the executable as a whole.
-
-
-
-
-
-
Package Selection
-
-
By default, when no package selection options are given, the packages selected
-depend on the selected manifest file (based on the current working directory if
---manifest-path
is not given). If the manifest is the root of a workspace then
-the workspaces default members are selected, otherwise only the package defined
-by the manifest will be selected.
-
-
-
The default members of a workspace can be set explicitly with the
-workspace.default-members
key in the root manifest. If this is not set, a
-virtual workspace will include all workspace members (equivalent to passing
---workspace
), and a non-virtual workspace will include only the root crate itself.
-
-
-
--p SPEC …
---package SPEC …
-
-Test only the specified packages. See cargo-pkgid(1) for the
-SPEC format. This flag may be specified multiple times.
-
---workspace
-
-Test all members in the workspace.
-
---all
-
-Deprecated alias for --workspace
.
-
---exclude SPEC …
-
-Exclude the specified packages. Must be used in conjunction with the
---workspace
flag. This flag may be specified multiple times.
-
-
-
-
-
-
Target Selection
-
-
When no target selection options are given, cargo test
will build the
-following targets of the selected packages:
-
-
-
-
-lib — used to link with binaries, examples, integration tests, and doc tests
-
-
-bins (only if integration tests are built and required features are
-available)
-
-
-examples — to ensure they compile
-
-
-lib as a unit test
-
-
-bins as unit tests
-
-
-integration tests
-
-
-doc tests for the lib target
-
-
-
-
-
The default behavior can be changed by setting the test
flag for the target
-in the manifest settings. Setting examples to test = true
will build and run
-the example as a test. Setting targets to test = false
will stop them from
-being tested by default. Target selection options that take a target by name
-ignore the test
flag and will always test the given target.
-
-
-
Doc tests for libraries may be disabled by setting doctest = false
for the
-library in the manifest.
-
-
-
Binary targets are automatically built if there is an integration test or
-benchmark. This allows an integration test to execute the binary to exercise
-and test its behavior. The CARGO_BIN_EXE_<name>
-environment variable
-is set when the integration test is built so that it can use the
-env
macro to locate the
-executable.
-
-
-
Passing target selection flags will test only the
-specified targets.
-
-
-
---lib
-
-Test the package’s library.
-
---bin NAME …
-
-Test the specified binary. This flag may be specified multiple times.
-
---bins
-
-Test all binary targets.
-
---example NAME …
-
-Test the specified example. This flag may be specified multiple times.
-
---examples
-
-Test all example targets.
-
---test NAME …
-
-Test the specified integration test. This flag may be specified multiple
-times.
-
---tests
-
-Test all targets in test mode that have the test = true
manifest
-flag set. By default this includes the library and binaries built as
-unittests, and integration tests. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-unittest, and once as a dependency for binaries, integration tests, etc.).
-Targets may be enabled or disabled by setting the test
flag in the
-manifest settings for the target.
-
---bench NAME …
-
-Test the specified benchmark. This flag may be specified multiple times.
-
---benches
-
-Test all targets in benchmark mode that have the bench = true
-manifest flag set. By default this includes the library and binaries built
-as benchmarks, and bench targets. Be aware that this will also build any
-required dependencies, so the lib target may be built twice (once as a
-benchmark, and once as a dependency for binaries, benchmarks, etc.).
-Targets may be enabled or disabled by setting the bench
flag in the
-manifest settings for the target.
-
---all-targets
-
-Test all targets. This is equivalent to specifying --lib --bins
---tests --benches --examples
.
-
---doc
-
-Test only the library’s documentation. This cannot be mixed with other
-target options.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Compilation Options
-
-
---target TRIPLE
-
-Test for the given architecture. The default is the host
-architecture. The general format of the triple is
-<arch><sub>-<vendor>-<sys>-<abi>
. Run rustc --print target-list
for a
-list of supported targets.
-
-
This may also be specified with the build.target
-config value .
-
-
-
Note that specifying this flag makes Cargo run in a different mode where the
-target artifacts are placed in a separate directory. See the
-build cache documentation for more details.
-
-
---release
-
-Test optimized artifacts with the release
profile. See the
-PROFILES section for details on how this affects profile selection.
-
-
-
-
-
-
Output Options
-
-
---target-dir DIRECTORY
-
-Directory for all generated artifacts and intermediate files. May also be
-specified with the CARGO_TARGET_DIR
environment variable, or the
-build.target-dir
config value . Defaults
-to target
in the root of the workspace.
-
-
-
-
-
-
Display Options
-
-
By default the Rust test harness hides output from test execution to keep
-results readable. Test output can be recovered (e.g., for debugging) by passing
---nocapture
to the test binaries:
-
-
-
-
cargo test -- --nocapture
-
-
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
---message-format FMT
-
-The output format for diagnostic messages. Can be specified multiple times
-and consists of comma-separated values. Valid values:
-
-
-
-human
(default): Display in a human-readable text format.
-
-
-short
: Emit shorter, human-readable text messages.
-
-
-json
: Emit JSON messages to stdout. See
-the reference
-for more details.
-
-
-json-diagnostic-short
: Ensure the rendered
field of JSON messages contains
-the "short" rendering from rustc.
-
-
-json-diagnostic-rendered-ansi
: Ensure the rendered
field of JSON messages
-contains embedded ANSI color codes for respecting rustc’s default color
-scheme.
-
-
-json-render-diagnostics
: Instruct Cargo to not include rustc diagnostics in
-in JSON messages printed, but instead Cargo itself should render the
-JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
-coming from rustc are still emitted.
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
Miscellaneous Options
-
-
The --jobs
argument affects the building of the test executable but does not
-affect how many threads are used when running the tests. The Rust test harness
-includes an option to control the number of threads used:
-
-
-
-
cargo test -j 2 -- --test-threads=2
-
-
-
-
--j N
---jobs N
-
-Number of parallel jobs to run. May also be specified with the
-build.jobs
config value . Defaults to
-the number of CPUs.
-
-
-
-
-
-
-
-
PROFILES
-
-
-
Profiles may be used to configure compiler options such as optimization levels
-and debug settings. See
-the reference
-for more details.
-
-
-
Profile selection depends on the target and crate being built. By default the
-dev
or test
profiles are used. If the --release
flag is given, then the
-release
or bench
profiles are used.
-
-
-
-
-
-
-
-
-
-Target
-Default Profile
---release
Profile
-
-
-
-
-lib, bin, example
-dev
-release
-
-
-test, bench, or any target
- in "test" or "bench" mode
-test
-bench
-
-
-
-
-
Dependencies use the dev
/release
profiles.
-
-
-
Unit tests are separate executable artifacts which use the test
/bench
-profiles. Example targets are built the same as with cargo build
(using the
-dev
/release
profiles) unless you are building them with the test harness
-(by setting test = true
in the manifest or using the --example
flag) in
-which case they use the test
/bench
profiles. Library targets are built
-with the dev
/release
profiles when linked to an integration test, binary,
-or doctest.
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Execute all the unit and integration tests of the current package:
-
-
-
-Run only tests whose names match against a filter string:
-
-
-
cargo test name_filter
-
-
-
-
-Run only a specific test within a specific integration test:
-
-
-
cargo test --test int_test_name -- modname::test_name
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-tree.html b/src/doc/man/generated/cargo-tree.html
deleted file mode 100644
index a9bee7b3015..00000000000
--- a/src/doc/man/generated/cargo-tree.html
+++ /dev/null
@@ -1,516 +0,0 @@
-NAME
-
-
cargo-tree - Display a tree visualization of a dependency graph
-
-
-
-
DESCRIPTION
-
-
-
This command will display a tree of dependencies to the terminal. An example
-of a simple project that depends on the "rand" package:
-
-
-
-
myproject v0.1.0 (/myproject)
-└── rand v0.7.3
- ├── getrandom v0.1.14
- │ ├── cfg-if v0.1.10
- │ └── libc v0.2.68
- ├── libc v0.2.68 (*)
- ├── rand_chacha v0.2.2
- │ ├── ppv-lite86 v0.2.6
- │ └── rand_core v0.5.1
- │ └── getrandom v0.1.14 (*)
- └── rand_core v0.5.1 (*)
-[build-dependencies]
-└── cc v1.0.50
-
-
-
-
Packages marked with (*)
have been "de-duplicated". The dependencies for the
-package have already been shown elswhere in the graph, and so are not
-repeated. Use the --no-dedupe
option to repeat the duplicates.
-
-
-
The -e
flag can be used to select the dependency kinds to display. The
-"features" kind changes the output to display the features enabled by
-each dependency. For example, cargo tree -e features
:
-
-
-
-
myproject v0.1.0 (/myproject)
-└── log feature "serde"
- └── log v0.4.8
- ├── serde v1.0.106
- └── cfg-if feature "default"
- └── cfg-if v0.1.10
-
-
-
-
In this tree, myproject
depends on log
with the serde
feature. log
in
-turn depends on cfg-if
with "default" features. When using -e features
it
-can be helpful to use -i
flag to show how the features flow into a package.
-See the examples below for more detail.
-
-
-
-
-
OPTIONS
-
-
-
Tree Options
-
-
--i SPEC
---invert SPEC
-
-Show the reverse dependencies for the given package. This flag will invert
-the tree and display the packages that depend on the given package.
-
-
Note that in a workspace, by default it will only display the package’s
-reverse dependencies inside the tree of the workspace member in the current
-directory. The --workspace
flag can be used to extend it so that it will
-show the package’s reverse dependencies across the entire workspace. The -p
-flag can be used to display the package’s reverse dependencies only with the
-subtree of the package given to -p
.
-
-
---no-dedupe
-
-Do not de-duplicate repeated dependencies. Usually, when a package has
-already displayed its dependencies, further occurrences will not
-re-display its dependencies, and will include a (*)
to indicate it has
-already been shown. This flag will cause those duplicates to be repeated.
-
--d
---duplicates
-
-Show only dependencies which come in multiple versions (implies
---invert
). When used with the -p
flag, only shows duplicates within
-the subtree of the given package.
-
-
It can be beneficial for build times and executable sizes to avoid building
-that same package multiple times. This flag can help identify the offending
-packages. You can then investigate if the package that depends on the
-duplicate with the older version can be updated to the newer version so that
-only one instance is built.
-
-
--e KINDS
---edges KINDS
-
-The dependency kinds to display. Takes a comma separated list of values:
-
-
-
-all
— Show all edge kinds.
-
-
-normal
— Show normal dependencies.
-
-
-build
— Show build dependencies.
-
-
-dev
— Show development dependencies.
-
-
-features
— Show features enabled by each dependency. If this is
-the only kind given, then it will automatically include the other
-dependency kinds.
-
-
-no-normal
— Do not include normal dependencies.
-
-
-no-build
— Do not include build dependencies.
-
-
-no-dev
— Do not include development dependencies.
-
-
-
-
-
The no-
prefixed options cannot be mixed with the other dependency kinds.
-
-
-
The default is normal,build,dev
.
-
-
---target TRIPLE
-
-Filter dependencies matching the given target-triple.
-The default is the host platform. Use the value all
to include all
-targets.
-
-
-
-
-
-
-
-
---charset CHARSET
-
-Chooses the character set to use for the tree. Valid values are "utf8" or
-"ascii". Default is "utf8".
-
--f FORMAT
---format FORMAT
-
-Set the format string for each package. The default is "{p}".
-
-
This is an arbitrary string which will be used to display each package. The following
-strings will be replaced with the corresponding value:
-
-
-
-
-{p}
— The package name.
-
-
-{l}
— The package license.
-
-
-{r}
— The package repository URL.
-
-
-{f}
— Comma-separated list of package features that are enabled.
-
-
-
-
---prefix PREFIX
-
-Sets how each line is displayed. The PREFIX value can be one of:
-
-
-
-indent
(default) — Shows each line indented as a tree.
-
-
-depth
— Show as a list, with the numeric depth printed before each entry.
-
-
-none
— Show as a flat list.
-
-
-
-
-
-
-
-
-
Package Selection
-
-
By default, when no package selection options are given, the packages selected
-depend on the selected manifest file (based on the current working directory if
---manifest-path
is not given). If the manifest is the root of a workspace then
-the workspaces default members are selected, otherwise only the package defined
-by the manifest will be selected.
-
-
-
The default members of a workspace can be set explicitly with the
-workspace.default-members
key in the root manifest. If this is not set, a
-virtual workspace will include all workspace members (equivalent to passing
---workspace
), and a non-virtual workspace will include only the root crate itself.
-
-
-
--p SPEC …
---package SPEC …
-
-Display only the specified packages. See cargo-pkgid(1) for the
-SPEC format. This flag may be specified multiple times.
-
---workspace
-
-Display all members in the workspace.
-
---exclude SPEC …
-
-Exclude the specified packages. Must be used in conjunction with the
---workspace
flag. This flag may be specified multiple times.
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
-
-
-
-
-
Feature Selection
-
-
The feature flags allow you to control the enabled features for the "current"
-package. The "current" package is the package in the current directory, or the
-one specified in --manifest-path
. If running in the root of a virtual
-workspace, then the default features are selected for all workspace members,
-or all features if --all-features
is specified.
-
-
-
When no feature options are given, the default
feature is activated for
-every selected package.
-
-
-
---features FEATURES
-
-Space or comma separated list of features to activate. These features only
-apply to the current directory’s package. Features of direct dependencies
-may be enabled with <dep-name>/<feature-name>
syntax. This flag may be
-specified multiple times, which enables all specified features.
-
---all-features
-
-Activate all available features of all selected packages.
-
---no-default-features
-
-Do not activate the default
feature of the current directory’s
-package.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Display the tree for the package in the current directory:
-
-
-
-Display all the packages that depend on the syn
package:
-
-
-
-Show the features enabled on each package:
-
-
-
cargo tree --format "{p} {f}"
-
-
-
-
-Show all packages that are built multiple times. This can happen if multiple
-semver-incompatible versions appear in the tree (like 1.0.0 and 2.0.0).
-
-
-
-Explain why features are enabled for the syn
package:
-
-
-
cargo tree -e features -i syn
-
-
-
-
The -e features
flag is used to show features. The -i
flag is used to
-invert the graph so that it displays the packages that depend on syn
. An
-example of what this would display:
-
-
-
-
syn v1.0.17
-├── syn feature "clone-impls"
-│ └── syn feature "default"
-│ └── rustversion v1.0.2
-│ └── rustversion feature "default"
-│ └── myproject v0.1.0 (/myproject)
-│ └── myproject feature "default" (command-line)
-├── syn feature "default" (*)
-├── syn feature "derive"
-│ └── syn feature "default" (*)
-├── syn feature "full"
-│ └── rustversion v1.0.2 (*)
-├── syn feature "parsing"
-│ └── syn feature "default" (*)
-├── syn feature "printing"
-│ └── syn feature "default" (*)
-├── syn feature "proc-macro"
-│ └── syn feature "default" (*)
-└── syn feature "quote"
- ├── syn feature "printing" (*)
- └── syn feature "proc-macro" (*)
-
-
-
-
To read this graph, you can follow the chain for each feature from the root to
-see why it is included. For example, the "full" feature is added by the
-rustversion
crate which is included from myproject
(with the default
-features), and myproject
is the package selected on the command-line. All
-of the other syn
features are added by the "default" feature ("quote" is
-added by "printing" and "proc-macro", both of which are default features).
-
-
-
If you’re having difficulty cross-referencing the de-duplicated (*)
entries,
-try with the --no-dedupe
flag to get the full output.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-uninstall.html b/src/doc/man/generated/cargo-uninstall.html
deleted file mode 100644
index 1ebfba2490f..00000000000
--- a/src/doc/man/generated/cargo-uninstall.html
+++ /dev/null
@@ -1,191 +0,0 @@
-NAME
-
-
cargo-uninstall - Remove a Rust binary
-
-
-
SYNOPSIS
-
-
-
cargo uninstall [OPTIONS ] [SPEC …]
-
-
-
-
-
DESCRIPTION
-
-
-
This command removes a package installed with cargo-install(1) . The SPEC
-argument is a package ID specification of the package to remove (see
-cargo-pkgid(1) ).
-
-
-
By default all binaries are removed for a crate but the --bin
and
---example
flags can be used to only remove particular binaries.
-
-
-
The installation root is determined, in order of precedence:
-
-
-
-
---root
option
-
-
-CARGO_INSTALL_ROOT
environment variable
-
-
-install.root
Cargo config value
-
-
-CARGO_HOME
environment variable
-
-
-$HOME/.cargo
-
-
-
-
-
-
-
OPTIONS
-
-
-
Install Options
-
-
--p
---package SPEC …
-
-Package to uninstall.
-
---bin NAME …
-
-Only uninstall the binary NAME .
-
---root DIR
-
-Directory to uninstall packages from.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Uninstall a previously installed package.
-
-
-
cargo uninstall ripgrep
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-update.html b/src/doc/man/generated/cargo-update.html
deleted file mode 100644
index 9cd2a3b560a..00000000000
--- a/src/doc/man/generated/cargo-update.html
+++ /dev/null
@@ -1,241 +0,0 @@
-NAME
-
-
cargo-update - Update dependencies as recorded in the local lock file
-
-
-
SYNOPSIS
-
-
-
cargo update [OPTIONS ]
-
-
-
-
-
DESCRIPTION
-
-
-
This command will update dependencies in the Cargo.lock
file to the latest
-version. It requires that the Cargo.lock
file already exists as generated
-by commands such as cargo-build(1) or cargo-generate-lockfile(1) .
-
-
-
-
-
OPTIONS
-
-
-
Update Options
-
-
--p SPEC …
---package SPEC …
-
-Update only the specified packages. This flag may be specified
-multiple times. See cargo-pkgid(1) for the SPEC format.
-
-
If packages are specified with the -p
flag, then a conservative update of
-the lockfile will be performed. This means that only the dependency specified
-by SPEC will be updated. Its transitive dependencies will be updated only if
-SPEC cannot be updated without updating dependencies. All other dependencies
-will remain locked at their currently recorded versions.
-
-
-
If -p
is not specified, all dependencies are updated.
-
-
---aggressive
-
-When used with -p
, dependencies of SPEC are forced to update as well.
-Cannot be used with --precise
.
-
---precise PRECISE
-
-When used with -p
, allows you to specify a specific version number to
-set the package to. If the package comes from a git repository, this can
-be a git revision (such as a SHA hash or tag).
-
---dry-run
-
-Displays what would be updated, but doesn’t actually write the lockfile.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Update all dependencies in the lockfile:
-
-
-
-Update only specific dependencies:
-
-
-
cargo update -p foo -p bar
-
-
-
-
-Set a specific dependency to a specific version:
-
-
-
cargo update -p foo --precise 1.2.3
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-vendor.html b/src/doc/man/generated/cargo-vendor.html
deleted file mode 100644
index 9e4a062e9e7..00000000000
--- a/src/doc/man/generated/cargo-vendor.html
+++ /dev/null
@@ -1,240 +0,0 @@
-NAME
-
-
cargo-vendor - Vendor all dependencies locally
-
-
-
SYNOPSIS
-
-
-
cargo vendor [OPTIONS ] [PATH ]
-
-
-
-
-
DESCRIPTION
-
-
-
This cargo subcommand will vendor all crates.io and git dependencies for a
-project into the specified directory at <path>
. After this command completes
-the vendor directory specified by <path>
will contain all remote sources from
-dependencies specified. Additional manifests beyond the default one can be
-specified with the -s
option.
-
-
-
The cargo vendor
command will also print out the configuration necessary
-to use the vendored sources, which you will need to add to .cargo/config.toml
.
-
-
-
-
-
OPTIONS
-
-
-
Vendor Options
-
-
--s MANIFEST
---sync MANIFEST
-
-Specify extra Cargo.toml
manifests to workspaces which should also be
-vendored and synced to the output.
-
---no-delete
-
-Don’t delete the "vendor" directory when vendoring, but rather keep all
-existing contents of the vendor directory
-
---respect-source-config
-
-Instead of ignoring [source]
configuration by default in .cargo/config.toml
-read it and use it when downloading crates from crates.io, for example
-
---versioned-dirs
-
-Normally versions are only added to disambiguate multiple versions of the
-same package. This option causes all directories in the "vendor" directory
-to be versioned, which makes it easier to track the history of vendored
-packages over time, and can help with the performance of re-vendoring when
-only a subset of the packages have changed.
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Vendor all dependencies into a local "vendor" folder
-
-
-
-Vendor all dependencies into a local "third-party/vendor" folder
-
-
-
cargo vendor third-party/vendor
-
-
-
-
-Vendor the current workspace as well as another to "vendor"
-
-
-
cargo vendor -s ../path/to/Cargo.toml
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-verify-project.html b/src/doc/man/generated/cargo-verify-project.html
deleted file mode 100644
index 8eabe22cead..00000000000
--- a/src/doc/man/generated/cargo-verify-project.html
+++ /dev/null
@@ -1,199 +0,0 @@
-NAME
-
-
cargo-verify-project - Check correctness of crate manifest
-
-
-
SYNOPSIS
-
-
-
cargo verify-project [OPTIONS ]
-
-
-
-
-
DESCRIPTION
-
-
-
This command will parse the local manifest and check its validity. It emits a
-JSON object with the result. A successful validation will display:
-
-
-
-
An invalid workspace will display:
-
-
-
-
{"invalid":"human-readable error message"}
-
-
-
-
-
-
OPTIONS
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---manifest-path PATH
-
-Path to the Cargo.toml
file. By default, Cargo searches for the
-Cargo.toml
file in the current directory or any parent directory.
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-The workspace is OK.
-
-1
-
-The workspace is invalid.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Check the current workspace for errors:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-version.html b/src/doc/man/generated/cargo-version.html
deleted file mode 100644
index 2c84a33d0c6..00000000000
--- a/src/doc/man/generated/cargo-version.html
+++ /dev/null
@@ -1,76 +0,0 @@
-NAME
-
-
cargo-version - Show version information
-
-
-
SYNOPSIS
-
-
-
cargo version [OPTIONS ]
-
-
-
-
-
DESCRIPTION
-
-
-
Displays the version of Cargo.
-
-
-
-
-
OPTIONS
-
-
-
--v
---verbose
-
-Display additional version information.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Display the version:
-
-
-
-The version is also available via flags:
-
-
-
cargo --version
-cargo -V
-
-
-
-
-Display extra version information:
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo-yank.html b/src/doc/man/generated/cargo-yank.html
deleted file mode 100644
index 5a899f9e187..00000000000
--- a/src/doc/man/generated/cargo-yank.html
+++ /dev/null
@@ -1,196 +0,0 @@
-NAME
-
-
cargo-yank - Remove a pushed crate from the index
-
-
-
SYNOPSIS
-
-
-
cargo yank [OPTIONS ] --vers VERSION [CRATE ]
-
-
-
-
-
DESCRIPTION
-
-
-
The yank command removes a previously published crate’s version from the
-server’s index. This command does not delete any data, and the crate will
-still be available for download via the registry’s download link.
-
-
-
Note that existing crates locked to a yanked version will still be able to
-download the yanked version to use it. Cargo will, however, not allow any new
-crates to be locked to any yanked version.
-
-
-
This command requires you to be authenticated with either the --token
option
-or using cargo-login(1) .
-
-
-
If the crate name is not specified, it will use the package name from the
-current directory.
-
-
-
-
-
OPTIONS
-
-
-
Yank Options
-
-
---vers VERSION
-
-The version to yank or un-yank.
-
---undo
-
-Undo a yank, putting a version back into the index.
-
---token TOKEN
-
-API token to use when authenticating. This overrides the token stored in
-the credentials file (which is created by cargo-login(1) ).
-
-
Cargo config environment variables can be
-used to override the tokens stored in the credentials file. The token for
-crates.io may be specified with the CARGO_REGISTRY_TOKEN
environment
-variable. Tokens for other registries may be specified with environment
-variables of the form CARGO_REGISTRIES_NAME_TOKEN
where NAME
is the name
-of the registry in all capital letters.
-
-
---index INDEX
-
-The URL of the registry index to use.
-
---registry REGISTRY
-
-Name of the registry to use. Registry names are defined in Cargo config files .
-If not specified, the default registry is used, which is defined by the
-registry.default
config key which defaults to crates-io
.
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
EXAMPLES
-
-
-
-
-Yank a crate from the index:
-
-
-
cargo yank --vers 1.0.7 foo
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated/cargo.html b/src/doc/man/generated/cargo.html
deleted file mode 100644
index 3c13db331aa..00000000000
--- a/src/doc/man/generated/cargo.html
+++ /dev/null
@@ -1,470 +0,0 @@
-NAME
-
-
cargo - The Rust package manager
-
-
-
SYNOPSIS
-
-
-
cargo [OPTIONS ] COMMAND [ARGS ]
-cargo [OPTIONS ] --version
-cargo [OPTIONS ] --list
-cargo [OPTIONS ] --help
-cargo [OPTIONS ] --explain CODE
-
-
-
-
-
DESCRIPTION
-
-
-
This program is a package manager and build tool for the Rust language,
-available at https://rust-lang.org .
-
-
-
-
-
COMMANDS
-
-
-
Build Commands
-
-
-cargo-bench(1)
-
-Execute benchmarks of a package.
-
-cargo-build(1)
-
-Compile a package.
-
-cargo-check(1)
-
-Check a local package and all of its dependencies for errors.
-
-cargo-clean(1)
-
-Remove artifacts that Cargo has generated in the past.
-
-cargo-doc(1)
-
-Build a package’s documentation.
-
-cargo-fetch(1)
-
-Fetch dependencies of a package from the network.
-
-cargo-fix(1)
-
-Automatically fix lint warnings reported by rustc.
-
-cargo-run(1)
-
-Run a binary or example of the local package.
-
-cargo-rustc(1)
-
-Compile a package, and pass extra options to the compiler.
-
-cargo-rustdoc(1)
-
-Build a package’s documentation, using specified custom flags.
-
-cargo-test(1)
-
-Execute unit and integration tests of a package.
-
-
-
-
-
-
-
-
-
-
-
-
OPTIONS
-
-
-
Special Options
-
-
--V
---version
-
-Print version info and exit. If used with --verbose
, prints extra
-information.
-
---list
-
-List all installed Cargo subcommands. If used with --verbose
, prints
-extra information.
-
---explain CODE
-
-Run rustc --explain CODE
which will print out a detailed explanation of
-an error message (for example, E0004
).
-
-
-
-
-
-
Display Options
-
-
--v
---verbose
-
-Use verbose output. May be specified twice for "very verbose" output which
-includes extra output such as dependency warnings and build script output.
-May also be specified with the term.verbose
-config value .
-
--q
---quiet
-
-No output printed to stdout.
-
---color WHEN
-
-Control when colored output is used. Valid values:
-
-
-
-auto
(default): Automatically detect if color support is available on the
-terminal.
-
-
-always
: Always display colors.
-
-
-never
: Never display colors.
-
-
-
-
-
-
-
-
-
-
Manifest Options
-
-
---frozen
---locked
-
-Either of these flags requires that the Cargo.lock
file is
-up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
-exit with an error. The --frozen
flag also prevents Cargo from
-attempting to access the network to determine if it is out-of-date.
-
-
These may be used in environments where you want to assert that the
-Cargo.lock
file is up-to-date (such as a CI build) or want to avoid network
-access.
-
-
---offline
-
-Prevents Cargo from accessing the network for any reason. Without this
-flag, Cargo will stop with an error if it needs to access the network and
-the network is not available. With this flag, Cargo will attempt to
-proceed without the network if possible.
-
-
Beware that this may result in different dependency resolution than online
-mode. Cargo will restrict itself to crates that are downloaded locally, even
-if there might be a newer version as indicated in the local copy of the index.
-See the cargo-fetch(1) command to download dependencies before going
-offline.
-
-
-
-
-
-
-
-
Common Options
-
-
-+TOOLCHAIN
-
-If Cargo has been installed with rustup, and the first argument to cargo
-begins with +
, it will be interpreted as a rustup toolchain name (such
-as +stable
or +nightly
).
-See the rustup documentation
-for more information about how toolchain overrides work.
-
--h
---help
-
-Prints help information.
-
--Z FLAG …
-
-Unstable (nightly-only) flags to Cargo. Run cargo -Z help
for
-details.
-
-
-
-
-
-
-
-
ENVIRONMENT
-
-
-
See the reference for
-details on environment variables that Cargo reads.
-
-
-
-
-
Exit Status
-
-
-
-0
-
-Cargo succeeded.
-
-101
-
-Cargo failed to complete.
-
-
-
-
-
-
-
FILES
-
-
-
-~/.cargo/
-
-Default location for Cargo’s "home" directory where it stores various
-files. The location can be changed with the CARGO_HOME
environment
-variable.
-
-$CARGO_HOME/bin/
-
-Binaries installed by cargo-install(1) will be located here. If using
-rustup, executables distributed with Rust are also located here.
-
-$CARGO_HOME/config.toml
-
-The global configuration file. See the reference
-for more information about configuration files.
-
-.cargo/config.toml
-
-Cargo automatically searches for a file named .cargo/config.toml
in the
-current directory, and all parent directories. These configuration files
-will be merged with the global configuration file.
-
-$CARGO_HOME/credentials.toml
-
-Private authentication information for logging in to a registry.
-
-$CARGO_HOME/registry/
-
-This directory contains cached downloads of the registry index and any
-downloaded dependencies.
-
-$CARGO_HOME/git/
-
-This directory contains cached downloads of git dependencies.
-
-
-
-
-
Please note that the internal structure of the $CARGO_HOME
directory is not
-stable yet and may be subject to change.
-
-
-
-
-
EXAMPLES
-
-
-
-
-Build a local package and all of its dependencies:
-
-
-
-Build a package with optimizations:
-
-
-
-Run tests for a cross-compiled target:
-
-
-
cargo test --target i686-unknown-linux-gnu
-
-
-
-
-Create a new package that builds an executable:
-
-
-
-Create a package in the current directory:
-
-
-
mkdir foo && cd foo
-cargo init .
-
-
-
-
-Learn about a command’s options and usage:
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/doc/man/generated_txt/cargo-bench.txt b/src/doc/man/generated_txt/cargo-bench.txt
new file mode 100644
index 00000000000..13b4cc6ab6f
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-bench.txt
@@ -0,0 +1,347 @@
+CARGO-BENCH(1)
+
+NAME
+ cargo-bench - Execute benchmarks of a package
+
+SYNOPSIS
+ cargo bench [options] [benchname] [-- bench-options]
+
+DESCRIPTION
+ Compile and execute benchmarks.
+
+ The benchmark filtering argument benchname and all the arguments
+ following the two dashes (--) are passed to the benchmark binaries and
+ thus to libtest (rustc's built in unit-test and micro-benchmarking
+ framework). If you are passing arguments to both Cargo and the binary,
+ the ones after -- go to the binary, the ones before go to Cargo. For
+ details about libtest's arguments see the output of cargo bench --
+ --help. As an example, this will run only the benchmark named foo (and
+ skip other similarly named benchmarks like foobar):
+
+ cargo bench -- foo --exact
+
+ Benchmarks are built with the --test option to rustc which creates an
+ executable with a main function that automatically runs all functions
+ annotated with the #[bench] attribute. Cargo passes the --bench flag to
+ the test harness to tell it to run only benchmarks.
+
+ The libtest harness may be disabled by setting harness = false in the
+ target manifest settings, in which case your code will need to provide
+ its own main function to handle running benchmarks.
+
+ Note: The #[bench] attribute
+
+ is currently unstable and only available on the nightly channel
+ . There
+ are some packages available on crates.io
+ that may help with running
+ benchmarks on the stable channel, such as Criterion
+ .
+
+OPTIONS
+ Benchmark Options
+ --no-run
+ Compile, but don't run benchmarks.
+
+ --no-fail-fast
+ Run all benchmarks regardless of failure. Without this flag, Cargo
+ will exit after the first executable fails. The Rust test harness
+ will run all benchmarks within the executable to completion, this
+ flag only applies to the executable as a whole.
+
+ Package Selection
+ By default, when no package selection options are given, the packages
+ selected depend on the selected manifest file (based on the current
+ working directory if --manifest-path is not given). If the manifest is
+ the root of a workspace then the workspaces default members are
+ selected, otherwise only the package defined by the manifest will be
+ selected.
+
+ The default members of a workspace can be set explicitly with the
+ workspace.default-members key in the root manifest. If this is not set,
+ a virtual workspace will include all workspace members (equivalent to
+ passing --workspace), and a non-virtual workspace will include only the
+ root crate itself.
+
+ -p spec..., --package spec...
+ Benchmark only the specified packages. See cargo-pkgid(1) for the
+ SPEC format. This flag may be specified multiple times.
+
+ --workspace
+ Benchmark all members in the workspace.
+
+ --all
+ Deprecated alias for --workspace.
+
+ --exclude SPEC...
+ Exclude the specified packages. Must be used in conjunction with the
+ --workspace flag. This flag may be specified multiple times.
+
+ Target Selection
+ When no target selection options are given, cargo bench will build the
+ following targets of the selected packages:
+
+ o lib — used to link with binaries and benchmarks
+
+ o bins (only if benchmark targets are built and required features are
+ available)
+
+ o lib as a benchmark
+
+ o bins as benchmarks
+
+ o benchmark targets
+
+ The default behavior can be changed by setting the bench flag for the
+ target in the manifest settings. Setting examples to bench = true will
+ build and run the example as a benchmark. Setting targets to bench =
+ false will stop them from being benchmarked by default. Target selection
+ options that take a target by name ignore the bench flag and will always
+ benchmark the given target.
+
+ Passing target selection flags will benchmark only the specified
+ targets.
+
+ --lib
+ Benchmark the package's library.
+
+ --bin name...
+ Benchmark the specified binary. This flag may be specified multiple
+ times.
+
+ --bins
+ Benchmark all binary targets.
+
+ --example name...
+ Benchmark the specified example. This flag may be specified multiple
+ times.
+
+ --examples
+ Benchmark all example targets.
+
+ --test name...
+ Benchmark the specified integration test. This flag may be specified
+ multiple times.
+
+ --tests
+ Benchmark all targets in test mode that have the test = true
+ manifest flag set. By default this includes the library and binaries
+ built as unittests, and integration tests. Be aware that this will
+ also build any required dependencies, so the lib target may be built
+ twice (once as a unittest, and once as a dependency for binaries,
+ integration tests, etc.). Targets may be enabled or disabled by
+ setting the test flag in the manifest settings for the target.
+
+ --bench name...
+ Benchmark the specified benchmark. This flag may be specified
+ multiple times.
+
+ --benches
+ Benchmark all targets in benchmark mode that have the bench = true
+ manifest flag set. By default this includes the library and binaries
+ built as benchmarks, and bench targets. Be aware that this will also
+ build any required dependencies, so the lib target may be built
+ twice (once as a benchmark, and once as a dependency for binaries,
+ benchmarks, etc.). Targets may be enabled or disabled by setting the
+ bench flag in the manifest settings for the target.
+
+ --all-targets
+ Benchmark all targets. This is equivalent to specifying --lib --bins
+ --tests --benches --examples.
+
+ Feature Selection
+ The feature flags allow you to control the enabled features for the
+ "current" package. The "current" package is the package in the current
+ directory, or the one specified in --manifest-path. If running in the
+ root of a virtual workspace, then the default features are selected for
+ all workspace members, or all features if --all-features is specified.
+
+ When no feature options are given, the default feature is activated for
+ every selected package.
+
+ --features features
+ Space or comma separated list of features to activate. These
+ features only apply to the current directory's package. Features of
+ direct dependencies may be enabled with /
+ syntax. This flag may be specified multiple times, which enables all
+ specified features.
+
+ --all-features
+ Activate all available features of all selected packages.
+
+ --no-default-features
+ Do not activate the default feature of the current directory's
+ package.
+
+ Compilation Options
+ --target triple
+ Benchmark for the given architecture. The default is the host
+ architecture. The general format of the triple is
+ ---. Run rustc --print target-list for
+ a list of supported targets.
+
+ This may also be specified with the build.target config value
+ .
+
+ Note that specifying this flag makes Cargo run in a different mode
+ where the target artifacts are placed in a separate directory. See
+ the build cache
+
+ documentation for more details.
+
+ Output Options
+ --target-dir directory
+ Directory for all generated artifacts and intermediate files. May
+ also be specified with the CARGO_TARGET_DIR environment variable, or
+ the build.target-dir config value
+ . Defaults to
+ target in the root of the workspace.
+
+ Display Options
+ By default the Rust test harness hides output from benchmark execution
+ to keep results readable. Benchmark output can be recovered (e.g., for
+ debugging) by passing --nocapture to the benchmark binaries:
+
+ cargo bench -- --nocapture
+
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ --message-format fmt
+ The output format for diagnostic messages. Can be specified multiple
+ times and consists of comma-separated values. Valid values:
+
+ o human (default): Display in a human-readable text format.
+
+ o short: Emit shorter, human-readable text messages.
+
+ o json: Emit JSON messages to stdout. See the reference
+
+ for more details.
+
+ o json-diagnostic-short: Ensure the rendered field of JSON messages
+ contains the "short" rendering from rustc.
+
+ o json-diagnostic-rendered-ansi: Ensure the rendered field of JSON
+ messages contains embedded ANSI color codes for respecting
+ rustc's default color scheme.
+
+ o json-render-diagnostics: Instruct Cargo to not include rustc
+ diagnostics in in JSON messages printed, but instead Cargo itself
+ should render the JSON diagnostics coming from rustc. Cargo's own
+ JSON diagnostics and others coming from rustc are still emitted.
+
+ Manifest Options
+ --manifest-path path
+ Path to the Cargo.toml file. By default, Cargo searches for the
+ Cargo.toml file in the current directory or any parent directory.
+
+ --frozen, --locked
+ Either of these flags requires that the Cargo.lock file is
+ up-to-date. If the lock file is missing, or it needs to be updated,
+ Cargo will exit with an error. The --frozen flag also prevents Cargo
+ from attempting to access the network to determine if it is
+ out-of-date.
+
+ These may be used in environments where you want to assert that the
+ Cargo.lock file is up-to-date (such as a CI build) or want to avoid
+ network access.
+
+ --offline
+ Prevents Cargo from accessing the network for any reason. Without
+ this flag, Cargo will stop with an error if it needs to access the
+ network and the network is not available. With this flag, Cargo will
+ attempt to proceed without the network if possible.
+
+ Beware that this may result in different dependency resolution than
+ online mode. Cargo will restrict itself to crates that are
+ downloaded locally, even if there might be a newer version as
+ indicated in the local copy of the index. See the cargo-fetch(1)
+ command to download dependencies before going offline.
+
+ May also be specified with the net.offline config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ Miscellaneous Options
+ The --jobs argument affects the building of the benchmark executable but
+ does not affect how many threads are used when running the benchmarks.
+ The Rust test harness runs benchmarks serially in a single thread.
+
+ -j N, --jobs N
+ Number of parallel jobs to run. May also be specified with the
+ build.jobs config value
+ . Defaults to
+ the number of CPUs.
+
+PROFILES
+ Profiles may be used to configure compiler options such as optimization
+ levels and debug settings. See the reference
+ for more
+ details.
+
+ Benchmarks are always built with the bench profile. Binary and lib
+ targets are built separately as benchmarks with the bench profile.
+ Library targets are built with the release profiles when linked to
+ binaries and benchmarks. Dependencies use the release profile.
+
+ If you need a debug build of a benchmark, try building it with
+ cargo-build(1) which will use the test profile which is by default
+ unoptimized and includes debug information. You can then run the
+ debug-enabled benchmark manually.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Build and execute all the benchmarks of the current package:
+
+ cargo bench
+
+ 2. Run only a specific benchmark within a specific benchmark target:
+
+ cargo bench --bench bench_name -- modname::some_benchmark
+
+SEE ALSO
+ cargo(1), cargo-test(1)
+
diff --git a/src/doc/man/generated_txt/cargo-build.txt b/src/doc/man/generated_txt/cargo-build.txt
new file mode 100644
index 00000000000..2d2dd17eadd
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-build.txt
@@ -0,0 +1,308 @@
+CARGO-BUILD(1)
+
+NAME
+ cargo-build - Compile the current package
+
+SYNOPSIS
+ cargo build [options]
+
+DESCRIPTION
+ Compile local packages and all of their dependencies.
+
+OPTIONS
+ Package Selection
+ By default, when no package selection options are given, the packages
+ selected depend on the selected manifest file (based on the current
+ working directory if --manifest-path is not given). If the manifest is
+ the root of a workspace then the workspaces default members are
+ selected, otherwise only the package defined by the manifest will be
+ selected.
+
+ The default members of a workspace can be set explicitly with the
+ workspace.default-members key in the root manifest. If this is not set,
+ a virtual workspace will include all workspace members (equivalent to
+ passing --workspace), and a non-virtual workspace will include only the
+ root crate itself.
+
+ -p spec..., --package spec...
+ Build only the specified packages. See cargo-pkgid(1) for the SPEC
+ format. This flag may be specified multiple times.
+
+ --workspace
+ Build all members in the workspace.
+
+ --all
+ Deprecated alias for --workspace.
+
+ --exclude SPEC...
+ Exclude the specified packages. Must be used in conjunction with the
+ --workspace flag. This flag may be specified multiple times.
+
+ Target Selection
+ When no target selection options are given, cargo build will build all
+ binary and library targets of the selected packages. Binaries are
+ skipped if they have required-features that are missing.
+
+ Passing target selection flags will build only the specified targets.
+
+ --lib
+ Build the package's library.
+
+ --bin name...
+ Build the specified binary. This flag may be specified multiple
+ times.
+
+ --bins
+ Build all binary targets.
+
+ --example name...
+ Build the specified example. This flag may be specified multiple
+ times.
+
+ --examples
+ Build all example targets.
+
+ --test name...
+ Build the specified integration test. This flag may be specified
+ multiple times.
+
+ --tests
+ Build all targets in test mode that have the test = true manifest
+ flag set. By default this includes the library and binaries built as
+ unittests, and integration tests. Be aware that this will also build
+ any required dependencies, so the lib target may be built twice
+ (once as a unittest, and once as a dependency for binaries,
+ integration tests, etc.). Targets may be enabled or disabled by
+ setting the test flag in the manifest settings for the target.
+
+ --bench name...
+ Build the specified benchmark. This flag may be specified multiple
+ times.
+
+ --benches
+ Build all targets in benchmark mode that have the bench = true
+ manifest flag set. By default this includes the library and binaries
+ built as benchmarks, and bench targets. Be aware that this will also
+ build any required dependencies, so the lib target may be built
+ twice (once as a benchmark, and once as a dependency for binaries,
+ benchmarks, etc.). Targets may be enabled or disabled by setting the
+ bench flag in the manifest settings for the target.
+
+ --all-targets
+ Build all targets. This is equivalent to specifying --lib --bins
+ --tests --benches --examples.
+
+ Feature Selection
+ The feature flags allow you to control the enabled features for the
+ "current" package. The "current" package is the package in the current
+ directory, or the one specified in --manifest-path. If running in the
+ root of a virtual workspace, then the default features are selected for
+ all workspace members, or all features if --all-features is specified.
+
+ When no feature options are given, the default feature is activated for
+ every selected package.
+
+ --features features
+ Space or comma separated list of features to activate. These
+ features only apply to the current directory's package. Features of
+ direct dependencies may be enabled with /
+ syntax. This flag may be specified multiple times, which enables all
+ specified features.
+
+ --all-features
+ Activate all available features of all selected packages.
+
+ --no-default-features
+ Do not activate the default feature of the current directory's
+ package.
+
+ Compilation Options
+ --target triple
+ Build for the given architecture. The default is the host
+ architecture. The general format of the triple is
+ ---. Run rustc --print target-list for
+ a list of supported targets.
+
+ This may also be specified with the build.target config value
+ .
+
+ Note that specifying this flag makes Cargo run in a different mode
+ where the target artifacts are placed in a separate directory. See
+ the build cache
+
+ documentation for more details.
+
+ --release
+ Build optimized artifacts with the release profile. See the PROFILES
+ section for details on how this affects profile selection.
+
+ Output Options
+ --target-dir directory
+ Directory for all generated artifacts and intermediate files. May
+ also be specified with the CARGO_TARGET_DIR environment variable, or
+ the build.target-dir config value
+ . Defaults to
+ target in the root of the workspace.
+
+ --out-dir directory
+ Copy final artifacts to this directory.
+
+ This option is unstable and available only on the nightly channel
+ and
+ requires the -Z unstable-options flag to enable. See
+ https://github.com/rust-lang/cargo/issues/6790 for more information.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ --message-format fmt
+ The output format for diagnostic messages. Can be specified multiple
+ times and consists of comma-separated values. Valid values:
+
+ o human (default): Display in a human-readable text format.
+
+ o short: Emit shorter, human-readable text messages.
+
+ o json: Emit JSON messages to stdout. See the reference
+
+ for more details.
+
+ o json-diagnostic-short: Ensure the rendered field of JSON messages
+ contains the "short" rendering from rustc.
+
+ o json-diagnostic-rendered-ansi: Ensure the rendered field of JSON
+ messages contains embedded ANSI color codes for respecting
+ rustc's default color scheme.
+
+ o json-render-diagnostics: Instruct Cargo to not include rustc
+ diagnostics in in JSON messages printed, but instead Cargo itself
+ should render the JSON diagnostics coming from rustc. Cargo's own
+ JSON diagnostics and others coming from rustc are still emitted.
+
+ --build-plan
+ Outputs a series of JSON messages to stdout that indicate the
+ commands to run the build.
+
+ This option is unstable and available only on the nightly channel
+ and
+ requires the -Z unstable-options flag to enable. See
+ for more
+ information.
+
+ Manifest Options
+ --manifest-path path
+ Path to the Cargo.toml file. By default, Cargo searches for the
+ Cargo.toml file in the current directory or any parent directory.
+
+ --frozen, --locked
+ Either of these flags requires that the Cargo.lock file is
+ up-to-date. If the lock file is missing, or it needs to be updated,
+ Cargo will exit with an error. The --frozen flag also prevents Cargo
+ from attempting to access the network to determine if it is
+ out-of-date.
+
+ These may be used in environments where you want to assert that the
+ Cargo.lock file is up-to-date (such as a CI build) or want to avoid
+ network access.
+
+ --offline
+ Prevents Cargo from accessing the network for any reason. Without
+ this flag, Cargo will stop with an error if it needs to access the
+ network and the network is not available. With this flag, Cargo will
+ attempt to proceed without the network if possible.
+
+ Beware that this may result in different dependency resolution than
+ online mode. Cargo will restrict itself to crates that are
+ downloaded locally, even if there might be a newer version as
+ indicated in the local copy of the index. See the cargo-fetch(1)
+ command to download dependencies before going offline.
+
+ May also be specified with the net.offline config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ Miscellaneous Options
+ -j N, --jobs N
+ Number of parallel jobs to run. May also be specified with the
+ build.jobs config value
+ . Defaults to
+ the number of CPUs.
+
+PROFILES
+ Profiles may be used to configure compiler options such as optimization
+ levels and debug settings. See the reference
+ for more
+ details.
+
+ Profile selection depends on the target and crate being built. By
+ default the dev or test profiles are used. If the --release flag is
+ given, then the release or bench profiles are used.
+
+ +----------------------------------------+-------------+--------------+
+ | Target | Default | --release |
+ | | Profile | Profile |
+ +----------------------------------------+-------------+--------------+
+ | lib, bin, example | dev | release |
+ +----------------------------------------+-------------+--------------+
+ | test, bench, or any target in "test" | test | bench |
+ | or "bench" mode | | |
+ +----------------------------------------+-------------+--------------+
+
+ Dependencies use the dev/release profiles.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Build the local package and all of its dependencies:
+
+ cargo build
+
+ 2. Build with optimizations:
+
+ cargo build --release
+
+SEE ALSO
+ cargo(1), cargo-rustc(1)
+
diff --git a/src/doc/man/generated_txt/cargo-check.txt b/src/doc/man/generated_txt/cargo-check.txt
new file mode 100644
index 00000000000..a2751713076
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-check.txt
@@ -0,0 +1,300 @@
+CARGO-CHECK(1)
+
+NAME
+ cargo-check - Check the current package
+
+SYNOPSIS
+ cargo check [options]
+
+DESCRIPTION
+ Check a local package and all of its dependencies for errors. This will
+ essentially compile the packages without performing the final step of
+ code generation, which is faster than running cargo build. The compiler
+ will save metadata files to disk so that future runs will reuse them if
+ the source has not been modified.
+
+OPTIONS
+ Package Selection
+ By default, when no package selection options are given, the packages
+ selected depend on the selected manifest file (based on the current
+ working directory if --manifest-path is not given). If the manifest is
+ the root of a workspace then the workspaces default members are
+ selected, otherwise only the package defined by the manifest will be
+ selected.
+
+ The default members of a workspace can be set explicitly with the
+ workspace.default-members key in the root manifest. If this is not set,
+ a virtual workspace will include all workspace members (equivalent to
+ passing --workspace), and a non-virtual workspace will include only the
+ root crate itself.
+
+ -p spec..., --package spec...
+ Check only the specified packages. See cargo-pkgid(1) for the SPEC
+ format. This flag may be specified multiple times.
+
+ --workspace
+ Check all members in the workspace.
+
+ --all
+ Deprecated alias for --workspace.
+
+ --exclude SPEC...
+ Exclude the specified packages. Must be used in conjunction with the
+ --workspace flag. This flag may be specified multiple times.
+
+ Target Selection
+ When no target selection options are given, cargo check will check all
+ binary and library targets of the selected packages. Binaries are
+ skipped if they have required-features that are missing.
+
+ Passing target selection flags will check only the specified targets.
+
+ --lib
+ Check the package's library.
+
+ --bin name...
+ Check the specified binary. This flag may be specified multiple
+ times.
+
+ --bins
+ Check all binary targets.
+
+ --example name...
+ Check the specified example. This flag may be specified multiple
+ times.
+
+ --examples
+ Check all example targets.
+
+ --test name...
+ Check the specified integration test. This flag may be specified
+ multiple times.
+
+ --tests
+ Check all targets in test mode that have the test = true manifest
+ flag set. By default this includes the library and binaries built as
+ unittests, and integration tests. Be aware that this will also build
+ any required dependencies, so the lib target may be built twice
+ (once as a unittest, and once as a dependency for binaries,
+ integration tests, etc.). Targets may be enabled or disabled by
+ setting the test flag in the manifest settings for the target.
+
+ --bench name...
+ Check the specified benchmark. This flag may be specified multiple
+ times.
+
+ --benches
+ Check all targets in benchmark mode that have the bench = true
+ manifest flag set. By default this includes the library and binaries
+ built as benchmarks, and bench targets. Be aware that this will also
+ build any required dependencies, so the lib target may be built
+ twice (once as a benchmark, and once as a dependency for binaries,
+ benchmarks, etc.). Targets may be enabled or disabled by setting the
+ bench flag in the manifest settings for the target.
+
+ --all-targets
+ Check all targets. This is equivalent to specifying --lib --bins
+ --tests --benches --examples.
+
+ Feature Selection
+ The feature flags allow you to control the enabled features for the
+ "current" package. The "current" package is the package in the current
+ directory, or the one specified in --manifest-path. If running in the
+ root of a virtual workspace, then the default features are selected for
+ all workspace members, or all features if --all-features is specified.
+
+ When no feature options are given, the default feature is activated for
+ every selected package.
+
+ --features features
+ Space or comma separated list of features to activate. These
+ features only apply to the current directory's package. Features of
+ direct dependencies may be enabled with /
+ syntax. This flag may be specified multiple times, which enables all
+ specified features.
+
+ --all-features
+ Activate all available features of all selected packages.
+
+ --no-default-features
+ Do not activate the default feature of the current directory's
+ package.
+
+ Compilation Options
+ --target triple
+ Check for the given architecture. The default is the host
+ architecture. The general format of the triple is
+ ---. Run rustc --print target-list for
+ a list of supported targets.
+
+ This may also be specified with the build.target config value
+ .
+
+ Note that specifying this flag makes Cargo run in a different mode
+ where the target artifacts are placed in a separate directory. See
+ the build cache
+
+ documentation for more details.
+
+ --release
+ Check optimized artifacts with the release profile. See the PROFILES
+ section for details on how this affects profile selection.
+
+ --profile name
+ Changes check behavior. Currently only test is supported, which will
+ check with the #[cfg(test)] attribute enabled. This is useful to
+ have it check unit tests which are usually excluded via the cfg
+ attribute. This does not change the actual profile used.
+
+ Output Options
+ --target-dir directory
+ Directory for all generated artifacts and intermediate files. May
+ also be specified with the CARGO_TARGET_DIR environment variable, or
+ the build.target-dir config value
+ . Defaults to
+ target in the root of the workspace.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ --message-format fmt
+ The output format for diagnostic messages. Can be specified multiple
+ times and consists of comma-separated values. Valid values:
+
+ o human (default): Display in a human-readable text format.
+
+ o short: Emit shorter, human-readable text messages.
+
+ o json: Emit JSON messages to stdout. See the reference
+
+ for more details.
+
+ o json-diagnostic-short: Ensure the rendered field of JSON messages
+ contains the "short" rendering from rustc.
+
+ o json-diagnostic-rendered-ansi: Ensure the rendered field of JSON
+ messages contains embedded ANSI color codes for respecting
+ rustc's default color scheme.
+
+ o json-render-diagnostics: Instruct Cargo to not include rustc
+ diagnostics in in JSON messages printed, but instead Cargo itself
+ should render the JSON diagnostics coming from rustc. Cargo's own
+ JSON diagnostics and others coming from rustc are still emitted.
+
+ Manifest Options
+ --manifest-path path
+ Path to the Cargo.toml file. By default, Cargo searches for the
+ Cargo.toml file in the current directory or any parent directory.
+
+ --frozen, --locked
+ Either of these flags requires that the Cargo.lock file is
+ up-to-date. If the lock file is missing, or it needs to be updated,
+ Cargo will exit with an error. The --frozen flag also prevents Cargo
+ from attempting to access the network to determine if it is
+ out-of-date.
+
+ These may be used in environments where you want to assert that the
+ Cargo.lock file is up-to-date (such as a CI build) or want to avoid
+ network access.
+
+ --offline
+ Prevents Cargo from accessing the network for any reason. Without
+ this flag, Cargo will stop with an error if it needs to access the
+ network and the network is not available. With this flag, Cargo will
+ attempt to proceed without the network if possible.
+
+ Beware that this may result in different dependency resolution than
+ online mode. Cargo will restrict itself to crates that are
+ downloaded locally, even if there might be a newer version as
+ indicated in the local copy of the index. See the cargo-fetch(1)
+ command to download dependencies before going offline.
+
+ May also be specified with the net.offline config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ Miscellaneous Options
+ -j N, --jobs N
+ Number of parallel jobs to run. May also be specified with the
+ build.jobs config value
+ . Defaults to
+ the number of CPUs.
+
+PROFILES
+ Profiles may be used to configure compiler options such as optimization
+ levels and debug settings. See the reference
+ for more
+ details.
+
+ Profile selection depends on the target and crate being built. By
+ default the dev or test profiles are used. If the --release flag is
+ given, then the release or bench profiles are used.
+
+ +----------------------------------------+-------------+--------------+
+ | Target | Default | --release |
+ | | Profile | Profile |
+ +----------------------------------------+-------------+--------------+
+ | lib, bin, example | dev | release |
+ +----------------------------------------+-------------+--------------+
+ | test, bench, or any target in "test" | test | bench |
+ | or "bench" mode | | |
+ +----------------------------------------+-------------+--------------+
+
+ Dependencies use the dev/release profiles.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Check the local package for errors:
+
+ cargo check
+
+ 2. Check all targets, including unit tests:
+
+ cargo check --all-targets --profile=test
+
+SEE ALSO
+ cargo(1), cargo-build(1)
+
diff --git a/src/doc/man/generated_txt/cargo-clean.txt b/src/doc/man/generated_txt/cargo-clean.txt
new file mode 100644
index 00000000000..4a55ae00736
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-clean.txt
@@ -0,0 +1,145 @@
+CARGO-CLEAN(1)
+
+NAME
+ cargo-clean - Remove generated artifacts
+
+SYNOPSIS
+ cargo clean [options]
+
+DESCRIPTION
+ Remove artifacts from the target directory that Cargo has generated in
+ the past.
+
+ With no options, cargo clean will delete the entire target directory.
+
+OPTIONS
+ Package Selection
+ When no packages are selected, all packages and all dependencies in the
+ workspace are cleaned.
+
+ -p spec..., --package spec...
+ Clean only the specified packages. This flag may be specified
+ multiple times. See cargo-pkgid(1) for the SPEC format.
+
+ Clean Options
+ --doc
+ This option will cause cargo clean to remove only the doc directory
+ in the target directory.
+
+ --release
+ Clean all artifacts that were built with the release or bench
+ profiles.
+
+ --target-dir directory
+ Directory for all generated artifacts and intermediate files. May
+ also be specified with the CARGO_TARGET_DIR environment variable, or
+ the build.target-dir config value
+ . Defaults to
+ target in the root of the workspace.
+
+ --target triple
+ Clean for the given architecture. The default is the host
+ architecture. The general format of the triple is
+ ---. Run rustc --print target-list for
+ a list of supported targets.
+
+ This may also be specified with the build.target config value
+ .
+
+ Note that specifying this flag makes Cargo run in a different mode
+ where the target artifacts are placed in a separate directory. See
+ the build cache
+
+ documentation for more details.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ Manifest Options
+ --manifest-path path
+ Path to the Cargo.toml file. By default, Cargo searches for the
+ Cargo.toml file in the current directory or any parent directory.
+
+ --frozen, --locked
+ Either of these flags requires that the Cargo.lock file is
+ up-to-date. If the lock file is missing, or it needs to be updated,
+ Cargo will exit with an error. The --frozen flag also prevents Cargo
+ from attempting to access the network to determine if it is
+ out-of-date.
+
+ These may be used in environments where you want to assert that the
+ Cargo.lock file is up-to-date (such as a CI build) or want to avoid
+ network access.
+
+ --offline
+ Prevents Cargo from accessing the network for any reason. Without
+ this flag, Cargo will stop with an error if it needs to access the
+ network and the network is not available. With this flag, Cargo will
+ attempt to proceed without the network if possible.
+
+ Beware that this may result in different dependency resolution than
+ online mode. Cargo will restrict itself to crates that are
+ downloaded locally, even if there might be a newer version as
+ indicated in the local copy of the index. See the cargo-fetch(1)
+ command to download dependencies before going offline.
+
+ May also be specified with the net.offline config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Remove the entire target directory:
+
+ cargo clean
+
+ 2. Remove only the release artifacts:
+
+ cargo clean --release
+
+SEE ALSO
+ cargo(1), cargo-build(1)
+
diff --git a/src/doc/man/generated_txt/cargo-doc.txt b/src/doc/man/generated_txt/cargo-doc.txt
new file mode 100644
index 00000000000..536fcbf927b
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-doc.txt
@@ -0,0 +1,266 @@
+CARGO-DOC(1)
+
+NAME
+ cargo-doc - Build a package's documentation
+
+SYNOPSIS
+ cargo doc [options]
+
+DESCRIPTION
+ Build the documentation for the local package and all dependencies. The
+ output is placed in target/doc in rustdoc's usual format.
+
+OPTIONS
+ Documentation 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.
+
+ --no-deps
+ Do not build documentation for dependencies.
+
+ --document-private-items
+ Include non-public items in the documentation.
+
+ Package Selection
+ By default, when no package selection options are given, the packages
+ selected depend on the selected manifest file (based on the current
+ working directory if --manifest-path is not given). If the manifest is
+ the root of a workspace then the workspaces default members are
+ selected, otherwise only the package defined by the manifest will be
+ selected.
+
+ The default members of a workspace can be set explicitly with the
+ workspace.default-members key in the root manifest. If this is not set,
+ a virtual workspace will include all workspace members (equivalent to
+ passing --workspace), and a non-virtual workspace will include only the
+ root crate itself.
+
+ -p spec..., --package spec...
+ Document only the specified packages. See cargo-pkgid(1) for the
+ SPEC format. This flag may be specified multiple times.
+
+ --workspace
+ Document all members in the workspace.
+
+ --all
+ Deprecated alias for --workspace.
+
+ --exclude SPEC...
+ Exclude the specified packages. Must be used in conjunction with the
+ --workspace flag. This flag may be specified multiple times.
+
+ Target Selection
+ When no target selection options are given, cargo doc will document all
+ binary and library targets of the selected package. The binary will be
+ skipped if its name is the same as the lib target. Binaries are skipped
+ if they have required-features that are missing.
+
+ The default behavior can be changed by setting doc = false for the
+ target in the manifest settings. Using target selection options will
+ ignore the doc flag and will always document the given target.
+
+ --lib
+ Document the package's library.
+
+ --bin name...
+ Document the specified binary. This flag may be specified multiple
+ times.
+
+ --bins
+ Document all binary targets.
+
+ Feature Selection
+ The feature flags allow you to control the enabled features for the
+ "current" package. The "current" package is the package in the current
+ directory, or the one specified in --manifest-path. If running in the
+ root of a virtual workspace, then the default features are selected for
+ all workspace members, or all features if --all-features is specified.
+
+ When no feature options are given, the default feature is activated for
+ every selected package.
+
+ --features features
+ Space or comma separated list of features to activate. These
+ features only apply to the current directory's package. Features of
+ direct dependencies may be enabled with /
+ syntax. This flag may be specified multiple times, which enables all
+ specified features.
+
+ --all-features
+ Activate all available features of all selected packages.
+
+ --no-default-features
+ Do not activate the default feature of the current directory's
+ package.
+
+ Compilation Options
+ --target triple
+ Document for the given architecture. The default is the host
+ architecture. The general format of the triple is
+ ---. Run rustc --print target-list for
+ a list of supported targets.
+
+ This may also be specified with the build.target config value
+ .
+
+ Note that specifying this flag makes Cargo run in a different mode
+ where the target artifacts are placed in a separate directory. See
+ the build cache
+
+ documentation for more details.
+
+ --release
+ Document optimized artifacts with the release profile. See the
+ PROFILES section for details on how this affects profile selection.
+
+ Output Options
+ --target-dir directory
+ Directory for all generated artifacts and intermediate files. May
+ also be specified with the CARGO_TARGET_DIR environment variable, or
+ the build.target-dir config value
+ . Defaults to
+ target in the root of the workspace.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ --message-format fmt
+ The output format for diagnostic messages. Can be specified multiple
+ times and consists of comma-separated values. Valid values:
+
+ o human (default): Display in a human-readable text format.
+
+ o short: Emit shorter, human-readable text messages.
+
+ o json: Emit JSON messages to stdout. See the reference
+
+ for more details.
+
+ o json-diagnostic-short: Ensure the rendered field of JSON messages
+ contains the "short" rendering from rustc.
+
+ o json-diagnostic-rendered-ansi: Ensure the rendered field of JSON
+ messages contains embedded ANSI color codes for respecting
+ rustc's default color scheme.
+
+ o json-render-diagnostics: Instruct Cargo to not include rustc
+ diagnostics in in JSON messages printed, but instead Cargo itself
+ should render the JSON diagnostics coming from rustc. Cargo's own
+ JSON diagnostics and others coming from rustc are still emitted.
+
+ Manifest Options
+ --manifest-path path
+ Path to the Cargo.toml file. By default, Cargo searches for the
+ Cargo.toml file in the current directory or any parent directory.
+
+ --frozen, --locked
+ Either of these flags requires that the Cargo.lock file is
+ up-to-date. If the lock file is missing, or it needs to be updated,
+ Cargo will exit with an error. The --frozen flag also prevents Cargo
+ from attempting to access the network to determine if it is
+ out-of-date.
+
+ These may be used in environments where you want to assert that the
+ Cargo.lock file is up-to-date (such as a CI build) or want to avoid
+ network access.
+
+ --offline
+ Prevents Cargo from accessing the network for any reason. Without
+ this flag, Cargo will stop with an error if it needs to access the
+ network and the network is not available. With this flag, Cargo will
+ attempt to proceed without the network if possible.
+
+ Beware that this may result in different dependency resolution than
+ online mode. Cargo will restrict itself to crates that are
+ downloaded locally, even if there might be a newer version as
+ indicated in the local copy of the index. See the cargo-fetch(1)
+ command to download dependencies before going offline.
+
+ May also be specified with the net.offline config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ Miscellaneous Options
+ -j N, --jobs N
+ Number of parallel jobs to run. May also be specified with the
+ build.jobs config value
+ . Defaults to
+ the number of CPUs.
+
+PROFILES
+ Profiles may be used to configure compiler options such as optimization
+ levels and debug settings. See the reference
+ for more
+ details.
+
+ Profile selection depends on the target and crate being built. By
+ default the dev or test profiles are used. If the --release flag is
+ given, then the release or bench profiles are used.
+
+ +----------------------------------------+-------------+--------------+
+ | Target | Default | --release |
+ | | Profile | Profile |
+ +----------------------------------------+-------------+--------------+
+ | lib, bin, example | dev | release |
+ +----------------------------------------+-------------+--------------+
+ | test, bench, or any target in "test" | test | bench |
+ | or "bench" mode | | |
+ +----------------------------------------+-------------+--------------+
+
+ Dependencies use the dev/release profiles.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Build the local package documentation and its dependencies and output
+ to target/doc.
+
+ cargo doc
+
+SEE ALSO
+ cargo(1), cargo-rustdoc(1), rustdoc(1)
+
diff --git a/src/doc/man/generated_txt/cargo-fetch.txt b/src/doc/man/generated_txt/cargo-fetch.txt
new file mode 100644
index 00000000000..5deccaf1855
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-fetch.txt
@@ -0,0 +1,128 @@
+CARGO-FETCH(1)
+
+NAME
+ cargo-fetch - Fetch dependencies of a package from the network
+
+SYNOPSIS
+ cargo fetch [options]
+
+DESCRIPTION
+ If a Cargo.lock file is available, this command will ensure that all of
+ the git dependencies and/or registry dependencies are downloaded and
+ locally available. Subsequent Cargo commands never touch the network
+ after a cargo fetch unless the lock file changes.
+
+ If the lock file is not available, then this command will generate the
+ lock file before fetching the dependencies.
+
+ If --target is not specified, then all target dependencies are fetched.
+
+ See also the cargo-prefetch
+ plugin which adds a command to download popular crates. This may be
+ useful if you plan to use Cargo without a network with the --offline
+ flag.
+
+OPTIONS
+ Fetch options
+ --target triple
+ Fetch for the given architecture. The default is the host
+ architecture. The general format of the triple is
+ ---. Run rustc --print target-list for
+ a list of supported targets.
+
+ This may also be specified with the build.target config value
+ .
+
+ Note that specifying this flag makes Cargo run in a different mode
+ where the target artifacts are placed in a separate directory. See
+ the build cache
+
+ documentation for more details.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ Manifest Options
+ --manifest-path path
+ Path to the Cargo.toml file. By default, Cargo searches for the
+ Cargo.toml file in the current directory or any parent directory.
+
+ --frozen, --locked
+ Either of these flags requires that the Cargo.lock file is
+ up-to-date. If the lock file is missing, or it needs to be updated,
+ Cargo will exit with an error. The --frozen flag also prevents Cargo
+ from attempting to access the network to determine if it is
+ out-of-date.
+
+ These may be used in environments where you want to assert that the
+ Cargo.lock file is up-to-date (such as a CI build) or want to avoid
+ network access.
+
+ --offline
+ Prevents Cargo from accessing the network for any reason. Without
+ this flag, Cargo will stop with an error if it needs to access the
+ network and the network is not available. With this flag, Cargo will
+ attempt to proceed without the network if possible.
+
+ Beware that this may result in different dependency resolution than
+ online mode. Cargo will restrict itself to crates that are
+ downloaded locally, even if there might be a newer version as
+ indicated in the local copy of the index. See the cargo-fetch(1)
+ command to download dependencies before going offline.
+
+ May also be specified with the net.offline config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Fetch all dependencies:
+
+ cargo fetch
+
+SEE ALSO
+ cargo(1), cargo-update(1), cargo-generate-lockfile(1)
+
diff --git a/src/doc/man/generated_txt/cargo-fix.txt b/src/doc/man/generated_txt/cargo-fix.txt
new file mode 100644
index 00000000000..b63933eec06
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-fix.txt
@@ -0,0 +1,354 @@
+CARGO-FIX(1)
+
+NAME
+ cargo-fix - Automatically fix lint warnings reported by rustc
+
+SYNOPSIS
+ cargo fix [options]
+
+DESCRIPTION
+ This Cargo subcommand will automatically take rustc's suggestions from
+ diagnostics like warnings and apply them to your source code. This is
+ intended to help automate tasks that rustc itself already knows how to
+ tell you to fix! The cargo fix subcommand is also being developed for
+ the Rust 2018 edition to provide code the ability to easily opt-in to
+ the new edition without having to worry about any breakage.
+
+ Executing cargo fix will under the hood execute cargo-check(1). Any
+ warnings applicable to your crate will be automatically fixed (if
+ possible) and all remaining warnings will be displayed when the check
+ process is finished. For example if you'd like to prepare for the 2018
+ edition, you can do so by executing:
+
+ cargo fix --edition
+
+ which behaves the same as cargo check --all-targets.
+
+ cargo fix is only capable of fixing code that is normally compiled with
+ cargo check. If code is conditionally enabled with optional features,
+ you will need to enable those features for that code to be analyzed:
+
+ cargo fix --edition --features foo
+
+ Similarly, other cfg expressions like platform-specific code will need
+ to pass --target to fix code for the given target.
+
+ cargo fix --edition --target x86_64-pc-windows-gnu
+
+ If you encounter any problems with cargo fix or otherwise have any
+ questions or feature requests please don't hesitate to file an issue at
+
+
+OPTIONS
+ Fix options
+ --broken-code
+ Fix code even if it already has compiler errors. This is useful if
+ cargo fix fails to apply the changes. It will apply the changes and
+ leave the broken code in the working directory for you to inspect
+ and manually fix.
+
+ --edition
+ Apply changes that will update the code to the latest edition. This
+ will not update the edition in the Cargo.toml manifest, which must
+ be updated manually.
+
+ --edition-idioms
+ Apply suggestions that will update code to the preferred style for
+ the current edition.
+
+ --allow-no-vcs
+ Fix code even if a VCS was not detected.
+
+ --allow-dirty
+ Fix code even if the working directory has changes.
+
+ --allow-staged
+ Fix code even if the working directory has staged changes.
+
+ Package Selection
+ By default, when no package selection options are given, the packages
+ selected depend on the selected manifest file (based on the current
+ working directory if --manifest-path is not given). If the manifest is
+ the root of a workspace then the workspaces default members are
+ selected, otherwise only the package defined by the manifest will be
+ selected.
+
+ The default members of a workspace can be set explicitly with the
+ workspace.default-members key in the root manifest. If this is not set,
+ a virtual workspace will include all workspace members (equivalent to
+ passing --workspace), and a non-virtual workspace will include only the
+ root crate itself.
+
+ -p spec..., --package spec...
+ Fix only the specified packages. See cargo-pkgid(1) for the SPEC
+ format. This flag may be specified multiple times.
+
+ --workspace
+ Fix all members in the workspace.
+
+ --all
+ Deprecated alias for --workspace.
+
+ --exclude SPEC...
+ Exclude the specified packages. Must be used in conjunction with the
+ --workspace flag. This flag may be specified multiple times.
+
+ Target Selection
+ When no target selection options are given, cargo fix will fix all
+ targets (--all-targets implied). Binaries are skipped if they have
+ required-features that are missing.
+
+ Passing target selection flags will fix only the specified targets.
+
+ --lib
+ Fix the package's library.
+
+ --bin name...
+ Fix the specified binary. This flag may be specified multiple times.
+
+ --bins
+ Fix all binary targets.
+
+ --example name...
+ Fix the specified example. This flag may be specified multiple
+ times.
+
+ --examples
+ Fix all example targets.
+
+ --test name...
+ Fix the specified integration test. This flag may be specified
+ multiple times.
+
+ --tests
+ Fix all targets in test mode that have the test = true manifest flag
+ set. By default this includes the library and binaries built as
+ unittests, and integration tests. Be aware that this will also build
+ any required dependencies, so the lib target may be built twice
+ (once as a unittest, and once as a dependency for binaries,
+ integration tests, etc.). Targets may be enabled or disabled by
+ setting the test flag in the manifest settings for the target.
+
+ --bench name...
+ Fix the specified benchmark. This flag may be specified multiple
+ times.
+
+ --benches
+ Fix all targets in benchmark mode that have the bench = true
+ manifest flag set. By default this includes the library and binaries
+ built as benchmarks, and bench targets. Be aware that this will also
+ build any required dependencies, so the lib target may be built
+ twice (once as a benchmark, and once as a dependency for binaries,
+ benchmarks, etc.). Targets may be enabled or disabled by setting the
+ bench flag in the manifest settings for the target.
+
+ --all-targets
+ Fix all targets. This is equivalent to specifying --lib --bins
+ --tests --benches --examples.
+
+ Feature Selection
+ The feature flags allow you to control the enabled features for the
+ "current" package. The "current" package is the package in the current
+ directory, or the one specified in --manifest-path. If running in the
+ root of a virtual workspace, then the default features are selected for
+ all workspace members, or all features if --all-features is specified.
+
+ When no feature options are given, the default feature is activated for
+ every selected package.
+
+ --features features
+ Space or comma separated list of features to activate. These
+ features only apply to the current directory's package. Features of
+ direct dependencies may be enabled with /
+ syntax. This flag may be specified multiple times, which enables all
+ specified features.
+
+ --all-features
+ Activate all available features of all selected packages.
+
+ --no-default-features
+ Do not activate the default feature of the current directory's
+ package.
+
+ Compilation Options
+ --target triple
+ Fix for the given architecture. The default is the host
+ architecture. The general format of the triple is
+ ---. Run rustc --print target-list for
+ a list of supported targets.
+
+ This may also be specified with the build.target config value
+ .
+
+ Note that specifying this flag makes Cargo run in a different mode
+ where the target artifacts are placed in a separate directory. See
+ the build cache
+
+ documentation for more details.
+
+ --release
+ Fix optimized artifacts with the release profile. See the PROFILES
+ section for details on how this affects profile selection.
+
+ --profile name
+ Changes fix behavior. Currently only test is supported, which will
+ fix with the #[cfg(test)] attribute enabled. This is useful to have
+ it fix unit tests which are usually excluded via the cfg attribute.
+ This does not change the actual profile used.
+
+ Output Options
+ --target-dir directory
+ Directory for all generated artifacts and intermediate files. May
+ also be specified with the CARGO_TARGET_DIR environment variable, or
+ the build.target-dir config value
+ . Defaults to
+ target in the root of the workspace.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ --message-format fmt
+ The output format for diagnostic messages. Can be specified multiple
+ times and consists of comma-separated values. Valid values:
+
+ o human (default): Display in a human-readable text format.
+
+ o short: Emit shorter, human-readable text messages.
+
+ o json: Emit JSON messages to stdout. See the reference
+
+ for more details.
+
+ o json-diagnostic-short: Ensure the rendered field of JSON messages
+ contains the "short" rendering from rustc.
+
+ o json-diagnostic-rendered-ansi: Ensure the rendered field of JSON
+ messages contains embedded ANSI color codes for respecting
+ rustc's default color scheme.
+
+ o json-render-diagnostics: Instruct Cargo to not include rustc
+ diagnostics in in JSON messages printed, but instead Cargo itself
+ should render the JSON diagnostics coming from rustc. Cargo's own
+ JSON diagnostics and others coming from rustc are still emitted.
+
+ Manifest Options
+ --manifest-path path
+ Path to the Cargo.toml file. By default, Cargo searches for the
+ Cargo.toml file in the current directory or any parent directory.
+
+ --frozen, --locked
+ Either of these flags requires that the Cargo.lock file is
+ up-to-date. If the lock file is missing, or it needs to be updated,
+ Cargo will exit with an error. The --frozen flag also prevents Cargo
+ from attempting to access the network to determine if it is
+ out-of-date.
+
+ These may be used in environments where you want to assert that the
+ Cargo.lock file is up-to-date (such as a CI build) or want to avoid
+ network access.
+
+ --offline
+ Prevents Cargo from accessing the network for any reason. Without
+ this flag, Cargo will stop with an error if it needs to access the
+ network and the network is not available. With this flag, Cargo will
+ attempt to proceed without the network if possible.
+
+ Beware that this may result in different dependency resolution than
+ online mode. Cargo will restrict itself to crates that are
+ downloaded locally, even if there might be a newer version as
+ indicated in the local copy of the index. See the cargo-fetch(1)
+ command to download dependencies before going offline.
+
+ May also be specified with the net.offline config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ Miscellaneous Options
+ -j N, --jobs N
+ Number of parallel jobs to run. May also be specified with the
+ build.jobs config value
+ . Defaults to
+ the number of CPUs.
+
+PROFILES
+ Profiles may be used to configure compiler options such as optimization
+ levels and debug settings. See the reference
+ for more
+ details.
+
+ Profile selection depends on the target and crate being built. By
+ default the dev or test profiles are used. If the --release flag is
+ given, then the release or bench profiles are used.
+
+ +----------------------------------------+-------------+--------------+
+ | Target | Default | --release |
+ | | Profile | Profile |
+ +----------------------------------------+-------------+--------------+
+ | lib, bin, example | dev | release |
+ +----------------------------------------+-------------+--------------+
+ | test, bench, or any target in "test" | test | bench |
+ | or "bench" mode | | |
+ +----------------------------------------+-------------+--------------+
+
+ Dependencies use the dev/release profiles.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Apply compiler suggestions to the local package:
+
+ cargo fix
+
+ 2. Convert a 2015 edition to 2018:
+
+ cargo fix --edition
+
+ 3. Apply suggested idioms for the current edition:
+
+ cargo fix --edition-idioms
+
+SEE ALSO
+ cargo(1), cargo-check(1)
+
diff --git a/src/doc/man/generated_txt/cargo-generate-lockfile.txt b/src/doc/man/generated_txt/cargo-generate-lockfile.txt
new file mode 100644
index 00000000000..5ef41c05dec
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-generate-lockfile.txt
@@ -0,0 +1,104 @@
+CARGO-GENERATE-LOCKFILE(1)
+
+NAME
+ cargo-generate-lockfile - Generate the lockfile for a package
+
+SYNOPSIS
+ cargo generate-lockfile [options]
+
+DESCRIPTION
+ This command will create the Cargo.lock lockfile for the current package
+ or workspace. If the lockfile already exists, it will be rebuilt if
+ there are any manifest changes or dependency updates.
+
+ See also cargo-update(1) which is also capable of creating a Cargo.lock
+ lockfile and has more options for controlling update behavior.
+
+OPTIONS
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ Manifest Options
+ --manifest-path path
+ Path to the Cargo.toml file. By default, Cargo searches for the
+ Cargo.toml file in the current directory or any parent directory.
+
+ --frozen, --locked
+ Either of these flags requires that the Cargo.lock file is
+ up-to-date. If the lock file is missing, or it needs to be updated,
+ Cargo will exit with an error. The --frozen flag also prevents Cargo
+ from attempting to access the network to determine if it is
+ out-of-date.
+
+ These may be used in environments where you want to assert that the
+ Cargo.lock file is up-to-date (such as a CI build) or want to avoid
+ network access.
+
+ --offline
+ Prevents Cargo from accessing the network for any reason. Without
+ this flag, Cargo will stop with an error if it needs to access the
+ network and the network is not available. With this flag, Cargo will
+ attempt to proceed without the network if possible.
+
+ Beware that this may result in different dependency resolution than
+ online mode. Cargo will restrict itself to crates that are
+ downloaded locally, even if there might be a newer version as
+ indicated in the local copy of the index. See the cargo-fetch(1)
+ command to download dependencies before going offline.
+
+ May also be specified with the net.offline config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Create or update the lockfile for the current package or workspace:
+
+ cargo generate-lockfile
+
+SEE ALSO
+ cargo(1), cargo-update(1)
+
diff --git a/src/doc/man/generated_txt/cargo-help.txt b/src/doc/man/generated_txt/cargo-help.txt
new file mode 100644
index 00000000000..ea87ddfdb48
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-help.txt
@@ -0,0 +1,23 @@
+CARGO-HELP(1)
+
+NAME
+ cargo-help - Get help for a Cargo command
+
+SYNOPSIS
+ cargo help [subcommand]
+
+DESCRIPTION
+ Prints a help message for the given command.
+
+EXAMPLES
+ 1. Get help for a command:
+
+ cargo help build
+
+ 2. Help is also available with the --help flag:
+
+ cargo build --help
+
+SEE ALSO
+ cargo(1)
+
diff --git a/src/doc/man/generated_txt/cargo-init.txt b/src/doc/man/generated_txt/cargo-init.txt
new file mode 100644
index 00000000000..9ef78f94280
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-init.txt
@@ -0,0 +1,150 @@
+CARGO-INIT(1)
+
+NAME
+ cargo-init - Create a new Cargo package in an existing directory
+
+SYNOPSIS
+ cargo init [options] [path]
+
+DESCRIPTION
+ This command will create a new Cargo manifest in the current directory.
+ Give a path as an argument to create in the given directory.
+
+ If there are typically-named Rust source files already in the directory,
+ those will be used. If not, then a sample src/main.rs file will be
+ created, or src/lib.rs if --lib is passed.
+
+ If the directory is not already in a VCS repository, then a new
+ repository is created (see --vcs below).
+
+ The "authors" field in the manifest is determined from the environment
+ or configuration settings. A name is required and is determined from
+ (first match wins):
+
+ o cargo-new.name Cargo config value
+
+ o CARGO_NAME environment variable
+
+ o GIT_AUTHOR_NAME environment variable
+
+ o GIT_COMMITTER_NAME environment variable
+
+ o user.name git configuration value
+
+ o USER environment variable
+
+ o USERNAME environment variable
+
+ o NAME environment variable
+
+ The email address is optional and is determined from:
+
+ o cargo-new.email Cargo config value
+
+ o CARGO_EMAIL environment variable
+
+ o GIT_AUTHOR_EMAIL environment variable
+
+ o GIT_COMMITTER_EMAIL environment variable
+
+ o user.email git configuration value
+
+ o EMAIL environment variable
+
+ See the reference
+ for more
+ information about configuration files.
+
+ See cargo-new(1) for a similar command which will create a new package
+ in a new directory.
+
+OPTIONS
+ Init Options
+ --bin
+ Create a package with a binary target (src/main.rs). This is the
+ default behavior.
+
+ --lib
+ Create a package with a library target (src/lib.rs).
+
+ --edition edition
+ Specify the Rust edition to use. Default is 2018. Possible values:
+ 2015, 2018
+
+ --name name
+ Set the package name. Defaults to the directory name.
+
+ --vcs vcs
+ Initialize a new VCS repository for the given version control system
+ (git, hg, pijul, or fossil) or do not initialize any version control
+ at all (none). If not specified, defaults to git or the
+ configuration value cargo-new.vcs, or none if already inside a VCS
+ repository.
+
+ --registry registry
+ This sets the publish field in Cargo.toml to the given registry name
+ which will restrict publishing only to that registry.
+
+ Registry names are defined in Cargo config files
+ . If not
+ specified, the default registry defined by the registry.default
+ config key is used. If the default registry is not set and
+ --registry is not used, the publish field will not be set which
+ means that publishing will not be restricted.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Create a binary Cargo package in the current directory:
+
+ cargo init
+
+SEE ALSO
+ cargo(1), cargo-new(1)
+
diff --git a/src/doc/man/generated_txt/cargo-install.txt b/src/doc/man/generated_txt/cargo-install.txt
new file mode 100644
index 00000000000..f02a8b23ece
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-install.txt
@@ -0,0 +1,298 @@
+CARGO-INSTALL(1)
+
+NAME
+ cargo-install - Build and install a Rust binary
+
+SYNOPSIS
+ cargo install [options] crate...
+ cargo install [options] --path path
+ cargo install [options] --git url [crate...]
+ cargo install [options] --list
+
+DESCRIPTION
+ This command manages Cargo's local set of installed binary crates. Only
+ packages which have executable [[bin]] or [[example]] targets can be
+ installed, and all executables are installed into the installation
+ root's bin folder.
+
+ The installation root is determined, in order of precedence:
+
+ o --root option
+
+ o CARGO_INSTALL_ROOT environment variable
+
+ o install.root Cargo config value
+
+
+ o CARGO_HOME environment variable
+
+ o $HOME/.cargo
+
+ There are multiple sources from which a crate can be installed. The
+ default location is crates.io but the --git, --path, and --registry
+ flags can change this source. If the source contains more than one
+ package (such as crates.io or a git repository with multiple crates) the
+ crate argument is required to indicate which crate should be installed.
+
+ Crates from crates.io can optionally specify the version they wish to
+ install via the --version flags, and similarly packages from git
+ repositories can optionally specify the branch, tag, or revision that
+ should be installed. If a crate has multiple binaries, the --bin
+ argument can selectively install only one of them, and if you'd rather
+ install examples the --example argument can be used as well.
+
+ If the package is already installed, Cargo will reinstall it if the
+ installed version does not appear to be up-to-date. If any of the
+ following values change, then Cargo will reinstall the package:
+
+ o The package version and source.
+
+ o The set of binary names installed.
+
+ o The chosen features.
+
+ o The release mode (--debug).
+
+ o The target (--target).
+
+ Installing with --path will always build and install, unless there are
+ conflicting binaries from another package. The --force flag may be used
+ to force Cargo to always reinstall the package.
+
+ If the source is crates.io or --git then by default the crate will be
+ built in a temporary target directory. To avoid this, the target
+ directory can be specified by setting the CARGO_TARGET_DIR environment
+ variable to a relative path. In particular, this can be useful for
+ caching build artifacts on continuous integration systems.
+
+ By default, the Cargo.lock file that is included with the package will
+ be ignored. This means that Cargo will recompute which versions of
+ dependencies to use, possibly using newer versions that have been
+ released since the package was published. The --locked flag can be used
+ to force Cargo to use the packaged Cargo.lock file if it is available.
+ This may be useful for ensuring reproducible builds, to use the exact
+ same set of dependencies that were available when the package was
+ published. It may also be useful if a newer version of a dependency is
+ published that no longer builds on your system, or has other problems.
+ The downside to using --locked is that you will not receive any fixes or
+ updates to any dependency. Note that Cargo did not start publishing
+ Cargo.lock files until version 1.37, which means packages published with
+ prior versions will not have a Cargo.lock file available.
+
+OPTIONS
+ Install Options
+ --vers version, --version version
+ Specify a version to install. This may be a version requirement
+ ,
+ like ~1.2, to have Cargo select the newest version from the given
+ requirement. If the version does not have a requirement operator
+ (such as ^ or ~), then it must be in the form MAJOR.MINOR.PATCH, and
+ will install exactly that version; it is not treated as a caret
+ requirement like Cargo dependencies are.
+
+ --git url
+ Git URL to install the specified crate from.
+
+ --branch branch
+ Branch to use when installing from git.
+
+ --tag tag
+ Tag to use when installing from git.
+
+ --rev sha
+ Specific commit to use when installing from git.
+
+ --path path
+ Filesystem path to local crate to install.
+
+ --list
+ List all installed packages and their versions.
+
+ -f, --force
+ Force overwriting existing crates or binaries. This can be used if a
+ package has installed a binary with the same name as another
+ package. This is also useful if something has changed on the system
+ that you want to rebuild with, such as a newer version of rustc.
+
+ --no-track
+ By default, Cargo keeps track of the installed packages with a
+ metadata file stored in the installation root directory. This flag
+ tells Cargo not to use or create that file. With this flag, Cargo
+ will refuse to overwrite any existing files unless the --force flag
+ is used. This also disables Cargo's ability to protect against
+ multiple concurrent invocations of Cargo installing at the same
+ time.
+
+ --bin name...
+ Install only the specified binary.
+
+ --bins
+ Install all binaries.
+
+ --example name...
+ Install only the specified example.
+
+ --examples
+ Install all examples.
+
+ --root dir
+ Directory to install packages into.
+
+ --registry registry
+ Name of the registry to use. Registry names are defined in Cargo
+ config files
+ . If not
+ specified, the default registry is used, which is defined by the
+ registry.default config key which defaults to crates-io.
+
+ --index index
+ The URL of the registry index to use.
+
+ Feature Selection
+ The feature flags allow you to control the enabled features for the
+ "current" package. The "current" package is the package in the current
+ directory, or the one specified in --manifest-path. If running in the
+ root of a virtual workspace, then the default features are selected for
+ all workspace members, or all features if --all-features is specified.
+
+ When no feature options are given, the default feature is activated for
+ every selected package.
+
+ --features features
+ Space or comma separated list of features to activate. These
+ features only apply to the current directory's package. Features of
+ direct dependencies may be enabled with /
+ syntax. This flag may be specified multiple times, which enables all
+ specified features.
+
+ --all-features
+ Activate all available features of all selected packages.
+
+ --no-default-features
+ Do not activate the default feature of the current directory's
+ package.
+
+ Compilation Options
+ --target triple
+ Install for the given architecture. The default is the host
+ architecture. The general format of the triple is
+ ---. Run rustc --print target-list for
+ a list of supported targets.
+
+ This may also be specified with the build.target config value
+ .
+
+ Note that specifying this flag makes Cargo run in a different mode
+ where the target artifacts are placed in a separate directory. See
+ the build cache
+
+ documentation for more details.
+
+ --target-dir directory
+ Directory for all generated artifacts and intermediate files. May
+ also be specified with the CARGO_TARGET_DIR environment variable, or
+ the build.target-dir config value
+ . Defaults to
+ target in the root of the workspace.
+
+ --debug
+ Build with the dev profile instead the release profile.
+
+ Manifest Options
+ --frozen, --locked
+ Either of these flags requires that the Cargo.lock file is
+ up-to-date. If the lock file is missing, or it needs to be updated,
+ Cargo will exit with an error. The --frozen flag also prevents Cargo
+ from attempting to access the network to determine if it is
+ out-of-date.
+
+ These may be used in environments where you want to assert that the
+ Cargo.lock file is up-to-date (such as a CI build) or want to avoid
+ network access.
+
+ --offline
+ Prevents Cargo from accessing the network for any reason. Without
+ this flag, Cargo will stop with an error if it needs to access the
+ network and the network is not available. With this flag, Cargo will
+ attempt to proceed without the network if possible.
+
+ Beware that this may result in different dependency resolution than
+ online mode. Cargo will restrict itself to crates that are
+ downloaded locally, even if there might be a newer version as
+ indicated in the local copy of the index. See the cargo-fetch(1)
+ command to download dependencies before going offline.
+
+ May also be specified with the net.offline config value
+ .
+
+ Miscellaneous Options
+ -j N, --jobs N
+ Number of parallel jobs to run. May also be specified with the
+ build.jobs config value
+ . Defaults to
+ the number of CPUs.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Install or upgrade a package from crates.io:
+
+ cargo install ripgrep
+
+ 2. Install or reinstall the package in the current directory:
+
+ cargo install --path .
+
+ 3. View the list of installed packages:
+
+ cargo install --list
+
+SEE ALSO
+ cargo(1), cargo-uninstall(1), cargo-search(1), cargo-publish(1)
+
diff --git a/src/doc/man/generated_txt/cargo-locate-project.txt b/src/doc/man/generated_txt/cargo-locate-project.txt
new file mode 100644
index 00000000000..ec1377fb568
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-locate-project.txt
@@ -0,0 +1,78 @@
+CARGO-LOCATE-PROJECT(1)
+
+NAME
+ cargo-locate-project - Print a JSON representation of a Cargo.toml
+ file's location
+
+SYNOPSIS
+ cargo locate-project [options]
+
+DESCRIPTION
+ This command will print a JSON object to stdout with the full path to
+ the Cargo.toml manifest.
+
+ See also cargo-metadata(1) which is capable of returning the path to a
+ workspace root.
+
+OPTIONS
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ Manifest Options
+ --manifest-path path
+ Path to the Cargo.toml file. By default, Cargo searches for the
+ Cargo.toml file in the current directory or any parent directory.
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Display the path to the manifest based on the current directory:
+
+ cargo locate-project
+
+SEE ALSO
+ cargo(1), cargo-metadata(1)
+
diff --git a/src/doc/man/generated_txt/cargo-login.txt b/src/doc/man/generated_txt/cargo-login.txt
new file mode 100644
index 00000000000..447c32c002f
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-login.txt
@@ -0,0 +1,87 @@
+CARGO-LOGIN(1)
+
+NAME
+ cargo-login - Save an API token from the registry locally
+
+SYNOPSIS
+ cargo login [options] [token]
+
+DESCRIPTION
+ This command will save the API token to disk so that commands that
+ require authentication, such as cargo-publish(1), will be automatically
+ authenticated. The token is saved in $CARGO_HOME/credentials.toml.
+ CARGO_HOME defaults to .cargo in your home directory.
+
+ If the token argument is not specified, it will be read from stdin.
+
+ The API token for crates.io may be retrieved from
+ .
+
+ Take care to keep the token secret, it should not be shared with anyone
+ else.
+
+OPTIONS
+ Login Options
+ --registry registry
+ Name of the registry to use. Registry names are defined in Cargo
+ config files
+ . If not
+ specified, the default registry is used, which is defined by the
+ registry.default config key which defaults to crates-io.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Save the API token to disk:
+
+ cargo login
+
+SEE ALSO
+ cargo(1), cargo-publish(1)
+
diff --git a/src/doc/man/generated_txt/cargo-metadata.txt b/src/doc/man/generated_txt/cargo-metadata.txt
new file mode 100644
index 00000000000..5ecd04f4445
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-metadata.txt
@@ -0,0 +1,407 @@
+CARGO-METADATA(1)
+
+:source-highlighter: highlightjs
+
+NAME
+ cargo-metadata - Machine-readable metadata about the current package
+
+SYNOPSIS
+ cargo metadata [options]
+
+DESCRIPTION
+ Output JSON to stdout containing information about the workspace members
+ and resolved dependencies of the current package.
+
+ It is recommended to include the --format-version flag to future-proof
+ your code to ensure the output is in the format you are expecting.
+
+ See the cargo_metadata crate
+ for a Rust API for reading the metadata.
+
+OUTPUT FORMAT
+ The output has the following format:
+
+ {
+ /* Array of all packages in the workspace.
+ It also includes all feature-enabled dependencies unless --no-deps is used.
+ */
+ "packages": [
+ {
+ /* The name of the package. */
+ "name": "my-package",
+ /* The version of the package. */
+ "version": "0.1.0",
+ /* The Package ID, a unique identifier for referring to the package. */
+ "id": "my-package 0.1.0 (path+file:///path/to/my-package)",
+ /* The license value from the manifest, or null. */
+ "license": "MIT/Apache-2.0",
+ /* The license-file value from the manifest, or null. */
+ "license_file": "LICENSE",
+ /* The description value from the manifest, or null. */
+ "description": "Package description.",
+ /* The source ID of the package. This represents where
+ a package is retrieved from.
+ This is null for path dependencies and workspace members.
+ For other dependencies, it is a string with the format:
+ - "registry+URL" for registry-based dependencies.
+ Example: "registry+https://github.com/rust-lang/crates.io-index"
+ - "git+URL" for git-based dependencies.
+ Example: "git+https://github.com/rust-lang/cargo?rev=5e85ba14aaa20f8133863373404cb0af69eeef2c#5e85ba14aaa20f8133863373404cb0af69eeef2c"
+ */
+ "source": null,
+ /* Array of dependencies declared in the package's manifest. */
+ "dependencies": [
+ {
+ /* The name of the dependency. */
+ "name": "bitflags",
+ /* The source ID of the dependency. May be null, see
+ description for the package source.
+ */
+ "source": "registry+https://github.com/rust-lang/crates.io-index",
+ /* The version requirement for the dependency.
+ Dependencies without a version requirement have a value of "*".
+ */
+ "req": "^1.0",
+ /* The dependency kind.
+ "dev", "build", or null for a normal dependency.
+ */
+ "kind": null,
+ /* If the dependency is renamed, this is the new name for
+ the dependency as a string. null if it is not renamed.
+ */
+ "rename": null,
+ /* Boolean of whether or not this is an optional dependency. */
+ "optional": false,
+ /* Boolean of whether or not default features are enabled. */
+ "uses_default_features": true,
+ /* Array of features enabled. */
+ "features": [],
+ /* The target platform for the dependency.
+ null if not a target dependency.
+ */
+ "target": "cfg(windows)",
+ /* A string of the URL of the registry this dependency is from.
+ If not specified or null, the dependency is from the default
+ registry (crates.io).
+ */
+ "registry": null
+ }
+ ],
+ /* Array of Cargo targets. */
+ "targets": [
+ {
+ /* Array of target kinds.
+ - lib targets list the `crate-type` values from the
+ manifest such as "lib", "rlib", "dylib",
+ "proc-macro", etc. (default ["lib"])
+ - binary is ["bin"]
+ - example is ["example"]
+ - integration test is ["test"]
+ - benchmark is ["bench"]
+ - build script is ["custom-build"]
+ */
+ "kind": [
+ "bin"
+ ],
+ /* Array of crate types.
+ - lib and example libraries list the `crate-type` values
+ from the manifest such as "lib", "rlib", "dylib",
+ "proc-macro", etc. (default ["lib"])
+ - all other target kinds are ["bin"]
+ */
+ "crate_types": [
+ "bin"
+ ],
+ /* The name of the target. */
+ "name": "my-package",
+ /* Absolute path to the root source file of the target. */
+ "src_path": "/path/to/my-package/src/main.rs",
+ /* The Rust edition of the target.
+ Defaults to the package edition.
+ */
+ "edition": "2018",
+ /* Array of required features.
+ This property is not included if no required features are set.
+ */
+ "required-features": ["feat1"],
+ /* Whether or not this target has doc tests enabled, and
+ the target is compatible with doc testing.
+ */
+ "doctest": false,
+ /* Whether or not this target should be built and run with `--test`
+ */
+ "test": true
+ }
+ ],
+ /* Set of features defined for the package.
+ Each feature maps to an array of features or dependencies it
+ enables.
+ */
+ "features": {
+ "default": [
+ "feat1"
+ ],
+ "feat1": [],
+ "feat2": []
+ },
+ /* Absolute path to this package's manifest. */
+ "manifest_path": "/path/to/my-package/Cargo.toml",
+ /* Package metadata.
+ This is null if no metadata is specified.
+ */
+ "metadata": {
+ "docs": {
+ "rs": {
+ "all-features": true
+ }
+ }
+ },
+ /* List of registries to which this package may be published.
+ Publishing is unrestricted if null, and forbidden if an empty array. */
+ "publish": [
+ "crates-io"
+ ],
+ /* Array of authors from the manifest.
+ Empty array if no authors specified.
+ */
+ "authors": [
+ "Jane Doe "
+ ],
+ /* Array of categories from the manifest. */
+ "categories": [
+ "command-line-utilities"
+ ],
+ /* Array of keywords from the manifest. */
+ "keywords": [
+ "cli"
+ ],
+ /* The readme value from the manifest or null if not specified. */
+ "readme": "README.md",
+ /* The repository value from the manifest or null if not specified. */
+ "repository": "https://github.com/rust-lang/cargo",
+ /* The default edition of the package.
+ Note that individual targets may have different editions.
+ */
+ "edition": "2018",
+ /* Optional string that is the name of a native library the package
+ is linking to.
+ */
+ "links": null,
+ }
+ ],
+ /* Array of members of the workspace.
+ Each entry is the Package ID for the package.
+ */
+ "workspace_members": [
+ "my-package 0.1.0 (path+file:///path/to/my-package)",
+ ],
+ // The resolved dependency graph for the entire workspace. The enabled
+ // features are based on the enabled features for the "current" package.
+ // Inactivated optional dependencies are not listed.
+ //
+ // This is null if --no-deps is specified.
+ //
+ // By default, this includes all dependencies for all target platforms.
+ // The `--filter-platform` flag may be used to narrow to a specific
+ // target triple.
+ "resolve": {
+ /* Array of nodes within the dependency graph.
+ Each node is a package.
+ */
+ "nodes": [
+ {
+ /* The Package ID of this node. */
+ "id": "my-package 0.1.0 (path+file:///path/to/my-package)",
+ /* The dependencies of this package, an array of Package IDs. */
+ "dependencies": [
+ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)"
+ ],
+ /* The dependencies of this package. This is an alternative to
+ "dependencies" which contains additional information. In
+ particular, this handles renamed dependencies.
+ */
+ "deps": [
+ {
+ /* The name of the dependency's library target.
+ If this is a renamed dependency, this is the new
+ name.
+ */
+ "name": "bitflags",
+ /* The Package ID of the dependency. */
+ "pkg": "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ /* Array of dependency kinds. Added in Cargo 1.40. */
+ "dep_kinds": [
+ {
+ /* The dependency kind.
+ "dev", "build", or null for a normal dependency.
+ */
+ "kind": null,
+ /* The target platform for the dependency.
+ null if not a target dependency.
+ */
+ "target": "cfg(windows)"
+ }
+ ]
+ }
+ ],
+ /* Array of features enabled on this package. */
+ "features": [
+ "default"
+ ]
+ }
+ ],
+ /* The root package of the workspace.
+ This is null if this is a virtual workspace. Otherwise it is
+ the Package ID of the root package.
+ */
+ "root": "my-package 0.1.0 (path+file:///path/to/my-package)"
+ },
+ /* The absolute path to the build directory where Cargo places its output. */
+ "target_directory": "/path/to/my-package/target",
+ /* The version of the schema for this metadata structure.
+ This will be changed if incompatible changes are ever made.
+ */
+ "version": 1,
+ /* The absolute path to the root of the workspace. */
+ "workspace_root": "/path/to/my-package"
+ /* Workspace metadata.
+ This is null if no metadata is specified. */
+ "metadata": {
+ "docs": {
+ "rs": {
+ "all-features": true
+ }
+ }
+ }
+ }
+
+OPTIONS
+ Output Options
+ --no-deps
+ Output information only about the workspace members and don't fetch
+ dependencies.
+
+ --format-version version
+ Specify the version of the output format to use. Currently 1 is the
+ only possible value.
+
+ --filter-platform triple
+ This filters the resolve output to only include dependencies for the
+ given target triple. Without this flag, the resolve includes all
+ targets.
+
+ Note that the dependencies listed in the "packages" array still
+ includes all dependencies. Each package definition is intended to be
+ an unaltered reproduction of the information within Cargo.toml.
+
+ Feature Selection
+ The feature flags allow you to control the enabled features for the
+ "current" package. The "current" package is the package in the current
+ directory, or the one specified in --manifest-path. If running in the
+ root of a virtual workspace, then the default features are selected for
+ all workspace members, or all features if --all-features is specified.
+
+ When no feature options are given, the default feature is activated for
+ every selected package.
+
+ --features features
+ Space or comma separated list of features to activate. These
+ features only apply to the current directory's package. Features of
+ direct dependencies may be enabled with /
+ syntax. This flag may be specified multiple times, which enables all
+ specified features.
+
+ --all-features
+ Activate all available features of all selected packages.
+
+ --no-default-features
+ Do not activate the default feature of the current directory's
+ package.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ Manifest Options
+ --manifest-path path
+ Path to the Cargo.toml file. By default, Cargo searches for the
+ Cargo.toml file in the current directory or any parent directory.
+
+ --frozen, --locked
+ Either of these flags requires that the Cargo.lock file is
+ up-to-date. If the lock file is missing, or it needs to be updated,
+ Cargo will exit with an error. The --frozen flag also prevents Cargo
+ from attempting to access the network to determine if it is
+ out-of-date.
+
+ These may be used in environments where you want to assert that the
+ Cargo.lock file is up-to-date (such as a CI build) or want to avoid
+ network access.
+
+ --offline
+ Prevents Cargo from accessing the network for any reason. Without
+ this flag, Cargo will stop with an error if it needs to access the
+ network and the network is not available. With this flag, Cargo will
+ attempt to proceed without the network if possible.
+
+ Beware that this may result in different dependency resolution than
+ online mode. Cargo will restrict itself to crates that are
+ downloaded locally, even if there might be a newer version as
+ indicated in the local copy of the index. See the cargo-fetch(1)
+ command to download dependencies before going offline.
+
+ May also be specified with the net.offline config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+ for more information about
+ how toolchain overrides work.
+
+ -h, --help
+ Prints help information.
+
+ -Z flag
+ Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
+ details.
+
+ENVIRONMENT
+ See the reference
+
+ for details on environment variables that Cargo reads.
+
+EXIT STATUS
+ o 0: Cargo succeeded.
+
+ o 101: Cargo failed to complete.
+
+EXAMPLES
+ 1. Output JSON about the current package:
+
+ cargo metadata --format-version=1
+
+SEE ALSO
+ cargo(1)
+
diff --git a/src/doc/man/generated_txt/cargo-new.txt b/src/doc/man/generated_txt/cargo-new.txt
new file mode 100644
index 00000000000..241db365829
--- /dev/null
+++ b/src/doc/man/generated_txt/cargo-new.txt
@@ -0,0 +1,145 @@
+CARGO-NEW(1)
+
+NAME
+ cargo-new - Create a new Cargo package
+
+SYNOPSIS
+ cargo new [options] path
+
+DESCRIPTION
+ This command will create a new Cargo package in the given directory.
+ This includes a simple template with a Cargo.toml manifest, sample
+ source file, and a VCS ignore file. If the directory is not already in a
+ VCS repository, then a new repository is created (see --vcs below).
+
+ The "authors" field in the manifest is determined from the environment
+ or configuration settings. A name is required and is determined from
+ (first match wins):
+
+ o cargo-new.name Cargo config value
+
+ o CARGO_NAME environment variable
+
+ o GIT_AUTHOR_NAME environment variable
+
+ o GIT_COMMITTER_NAME environment variable
+
+ o user.name git configuration value
+
+ o USER environment variable
+
+ o USERNAME environment variable
+
+ o NAME environment variable
+
+ The email address is optional and is determined from:
+
+ o cargo-new.email Cargo config value
+
+ o CARGO_EMAIL environment variable
+
+ o GIT_AUTHOR_EMAIL environment variable
+
+ o GIT_COMMITTER_EMAIL environment variable
+
+ o user.email git configuration value
+
+ o EMAIL environment variable
+
+ See the reference
+ for more
+ information about configuration files.
+
+ See cargo-init(1) for a similar command which will create a new manifest
+ in an existing directory.
+
+OPTIONS
+ New Options
+ --bin
+ Create a package with a binary target (src/main.rs). This is the
+ default behavior.
+
+ --lib
+ Create a package with a library target (src/lib.rs).
+
+ --edition edition
+ Specify the Rust edition to use. Default is 2018. Possible values:
+ 2015, 2018
+
+ --name name
+ Set the package name. Defaults to the directory name.
+
+ --vcs vcs
+ Initialize a new VCS repository for the given version control system
+ (git, hg, pijul, or fossil) or do not initialize any version control
+ at all (none). If not specified, defaults to git or the
+ configuration value cargo-new.vcs, or none if already inside a VCS
+ repository.
+
+ --registry registry
+ This sets the publish field in Cargo.toml to the given registry name
+ which will restrict publishing only to that registry.
+
+ Registry names are defined in Cargo config files
+ . If not
+ specified, the default registry defined by the registry.default
+ config key is used. If the default registry is not set and
+ --registry is not used, the publish field will not be set which
+ means that publishing will not be restricted.
+
+ Display Options
+ -v, --verbose
+ Use verbose output. May be specified twice for "very verbose" output
+ which includes extra output such as dependency warnings and build
+ script output. May also be specified with the term.verbose config
+ value .
+
+ -q, --quiet
+ No output printed to stdout.
+
+ --color when
+ Control when colored output is used. Valid values:
+
+ o auto (default): Automatically detect if color support is
+ available on the terminal.
+
+ o always: Always display colors.
+
+ o never: Never display colors.
+
+ May also be specified with the term.color config value
+ .
+
+ Common Options
+ +toolchain
+ If Cargo has been installed with rustup, and the first argument to
+ cargo begins with +, it will be interpreted as a rustup toolchain
+ name (such as +stable or +nightly). See the rustup documentation
+