Skip to content

Commit 2f6357f

Browse files
committed
docs(ref): Move metadata to last
1 parent 41d157e commit 2f6357f

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/doc/src/reference/workspaces.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ In the `Cargo.toml`, the `[workspace]` table supports the following sections:
2222
* [`members`](#the-members-and-exclude-fields) — Packages to include in the workspace.
2323
* [`exclude`](#the-members-and-exclude-fields) — Packages to exclude from the workspace.
2424
* [`default-members`](#the-default-members-field) — Packages to operate on when a specific package wasn't selected.
25-
* [`metadata`](#the-metadata-table) — Extra settings for external tools.
2625
* [`package`](#the-package-table) — Keys for inheriting in packages.
2726
* [`dependencies`](#the-dependencies-table) — Keys for inheriting in package dependencies.
27+
* [`metadata`](#the-metadata-table) — Extra settings for external tools.
2828
* [`[patch]`](overriding-dependencies.md#the-patch-section) — Override dependencies.
2929
* [`[replace]`](overriding-dependencies.md#the-replace-section) — Override dependencies (deprecated).
3030
* [`[profile]`](profiles.md) — Compiler settings and optimizations.
@@ -131,29 +131,6 @@ default-members = ["path/to/member2", "path/to/member3/foo"]
131131

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

134-
### The `metadata` table
135-
136-
The `workspace.metadata` table is ignored by Cargo and will not be warned
137-
about. This section can be used for tools that would like to store workspace
138-
configuration in `Cargo.toml`. For example:
139-
140-
```toml
141-
[workspace]
142-
members = ["member1", "member2"]
143-
144-
[workspace.metadata.webcontents]
145-
root = "path/to/webproject"
146-
tool = ["npm", "run", "build"]
147-
# ...
148-
```
149-
150-
There is a similar set of tables at the package level at
151-
[`package.metadata`][package-metadata]. While cargo does not specify a
152-
format for the content of either of these tables, it is suggested that
153-
external tools may wish to use them in a consistent fashion, such as referring
154-
to the data in `workspace.metadata` if data is missing from `package.metadata`,
155-
if that makes sense for the tool in question.
156-
157134
### The `package` table
158135

159136
The `workspace.package` table is where you define keys that can be
@@ -238,6 +215,29 @@ cc.workspace = true
238215
rand.workspace = true
239216
```
240217

218+
### The `metadata` table
219+
220+
The `workspace.metadata` table is ignored by Cargo and will not be warned
221+
about. This section can be used for tools that would like to store workspace
222+
configuration in `Cargo.toml`. For example:
223+
224+
```toml
225+
[workspace]
226+
members = ["member1", "member2"]
227+
228+
[workspace.metadata.webcontents]
229+
root = "path/to/webproject"
230+
tool = ["npm", "run", "build"]
231+
# ...
232+
```
233+
234+
There is a similar set of tables at the package level at
235+
[`package.metadata`][package-metadata]. While cargo does not specify a
236+
format for the content of either of these tables, it is suggested that
237+
external tools may wish to use them in a consistent fashion, such as referring
238+
to the data in `workspace.metadata` if data is missing from `package.metadata`,
239+
if that makes sense for the tool in question.
240+
241241
[package]: manifest.md#the-package-section
242242
[package-metadata]: manifest.md#the-metadata-table
243243
[output directory]: ../guide/build-cache.md

0 commit comments

Comments
 (0)