Skip to content

Commit

Permalink
docs(ref): Move metadata to last
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 13, 2022
1 parent 03cc059 commit e5d822a
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/doc/src/reference/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ The `[workspace]` table supports the following sections:
* [`members`](#the-members-and-exclude-fields) — Packages to include in the workspace.
* [`exclude`](#the-members-and-exclude-fields) — Packages to exclude from the workspace.
* [`default-members`](#the-default-members-field) — Packages to operate on when a specific package wasn't selected.
* [`metadata`](#the-metadata-table) — Extra settings for external tools.
* [`package`](#the-package-table) — Keys for inheriting in packages.
* [`dependencies`](#the-dependencies-table) — Keys for inheriting in package dependencies.
* [`metadata`](#the-metadata-table) — Extra settings for external tools.
* [`[patch]`](overriding-dependencies.md#the-patch-section) — Override dependencies.
* [`[replace]`](overriding-dependencies.md#the-replace-section) — Override dependencies (deprecated).
* [`[profile]`](profiles.md) — Compiler settings and optimizations.
Expand Down Expand Up @@ -132,29 +132,6 @@ default-members = ["path/to/member2", "path/to/member3/foo"]

When specified, `default-members` must expand to a subset of `members`.

### The `metadata` table

The `workspace.metadata` table is ignored by Cargo and will not be warned
about. This section can be used for tools that would like to store workspace
configuration in `Cargo.toml`. For example:

```toml
[workspace]
members = ["member1", "member2"]

[workspace.metadata.webcontents]
root = "path/to/webproject"
tool = ["npm", "run", "build"]
# ...
```

There is a similar set of tables at the package level at
[`package.metadata`][package-metadata]. While cargo does not specify a
format for the content of either of these tables, it is suggested that
external tools may wish to use them in a consistent fashion, such as referring
to the data in `workspace.metadata` if data is missing from `package.metadata`,
if that makes sense for the tool in question.

### The `package` table

The `workspace.package` table is where you define keys that can be
Expand Down Expand Up @@ -239,6 +216,29 @@ cc.workspace = true
rand.workspace = true
```

### The `metadata` table

The `workspace.metadata` table is ignored by Cargo and will not be warned
about. This section can be used for tools that would like to store workspace
configuration in `Cargo.toml`. For example:

```toml
[workspace]
members = ["member1", "member2"]

[workspace.metadata.webcontents]
root = "path/to/webproject"
tool = ["npm", "run", "build"]
# ...
```

There is a similar set of tables at the package level at
[`package.metadata`][package-metadata]. While cargo does not specify a
format for the content of either of these tables, it is suggested that
external tools may wish to use them in a consistent fashion, such as referring
to the data in `workspace.metadata` if data is missing from `package.metadata`,
if that makes sense for the tool in question.

[package]: manifest.md#the-package-section
[package-metadata]: manifest.md#the-metadata-table
[output directory]: ../guide/build-cache.md
Expand Down

0 comments on commit e5d822a

Please sign in to comment.