@@ -221,6 +221,34 @@ workspace = "path/to/workspace/root"
221
221
222
222
For more information, see the documentation for the workspace table below.
223
223
224
+ #### The ` license ` and ` license-file ` fields (optional)
225
+
226
+ The ` license ` field can be set to an [ SPDX 2.1 license
227
+ expression] [ spdx-2.1-license-expressions ] for the package. Currently crates.io
228
+ will validate the license provided against a whitelist of known license and
229
+ exception identifiers from the [ SPDX license list 3.6] [ spdx-license-list-3.6 ] .
230
+ Parentheses are not currently supported.
231
+
232
+ Previously multiple licenses could be separated with a ` / ` , but that usage is
233
+ deprecated. Instead, use a license expression with AND and OR operators to get
234
+ more explicit semantics.
235
+
236
+ ``` toml
237
+ [package ]
238
+ # ...
239
+ license = " MIT OR Apache-2.0"
240
+ ```
241
+
242
+ If a package is using a nonstandard license, then the ` license-file ` field may
243
+ be specified in lieu of the ` license ` field. It must point to a file relative to
244
+ this manifest (similar to the ` readme ` field).
245
+
246
+ ``` toml
247
+ [package ]
248
+ # ...
249
+ license-file = " ..."
250
+ ```
251
+
224
252
#### Package metadata
225
253
226
254
There are a number of optional metadata fields also accepted under the
@@ -255,35 +283,31 @@ keywords = ["...", "..."]
255
283
# Categories are a fixed list available at crates.io/category_slugs, and
256
284
# they must match exactly.
257
285
categories = [" ..." , " ..." ]
286
+ ```
258
287
259
- # This is an SPDX 2.1 license expression for this package. Currently
260
- # crates.io will validate the license provided against a whitelist of
261
- # known license and exception identifiers from the SPDX license list
262
- # 3.6. Parentheses are not currently supported.
263
- #
264
- # Multiple licenses can be separated with a `/`, although that usage
265
- # is deprecated. Instead, use a license expression with AND and OR
266
- # operators to get more explicit semantics.
267
- license = " ..."
268
-
269
- # If a package is using a nonstandard license, then this key may be specified in
270
- # lieu of the above key and must point to a file relative to this manifest
271
- # (similar to the readme key).
272
- license-file = " ..."
288
+ The [ crates.io] ( https://crates.io ) registry will render the description, display
289
+ the license, link to the three URLs and categorize by the keywords. These keys
290
+ provide useful information to users of the registry and also influence the
291
+ search ranking of a crate. It is highly discouraged to omit everything in a
292
+ published crate.
293
+
294
+ ### The ` [badges] ` section
295
+
296
+ crates.io can display various badges for build status, test coverage, etc. for
297
+ each crate. All badges are optional.
298
+
299
+ - The badges pertaining to build status that are currently available are
300
+ Appveyor, CircleCI, Cirrus CI, GitLab, Azure DevOps, Travis CI and Bitbucket
301
+ Pipelines.
302
+ - Available badges pertaining to code test coverage are Codecov and Coveralls.
303
+ - There are also maintenance-related badges based on isitmaintained.com
304
+ which state the issue resolution time, percent of open issues, and future
305
+ maintenance intentions.
306
+
307
+ Most badge specifications require a ` repository ` key. It is expected to be in
308
+ ` user/repo ` format.
273
309
274
- # Optional specification of badges to be displayed on crates.io.
275
- #
276
- # - The badges pertaining to build status that are currently available are
277
- # Appveyor, CircleCI, Cirrus CI, GitLab, Azure DevOps, Travis CI and Bitbucket
278
- # Pipelines.
279
- # - Available badges pertaining to code test coverage are Codecov and
280
- # Coveralls.
281
- # - There are also maintenance-related badges based on isitmaintained.com
282
- # which state the issue resolution time, percent of open issues, and future
283
- # maintenance intentions.
284
- #
285
- # If a `repository` key is required, this refers to a repository in
286
- # `user/repo` format.
310
+ ``` toml
287
311
[badges ]
288
312
289
313
# Appveyor: `repository` is required. `branch` is optional; default is `master`
@@ -346,17 +370,6 @@ is-it-maintained-open-issues = { repository = "..." }
346
370
maintenance = { status = " ..." }
347
371
```
348
372
349
- The [ crates.io] ( https://crates.io ) registry will render the description, display
350
- the license, link to the three URLs and categorize by the keywords. These keys
351
- provide useful information to users of the registry and also influence the
352
- search ranking of a crate. It is highly discouraged to omit everything in a
353
- published crate.
354
-
355
- SPDX 2.1 license expressions are documented
356
- [ here] [ spdx-2.1-license-expressions ] . The current version of the
357
- license list is available [ here] [ spdx-license-list ] , and version 3.6
358
- is available [ here] [ spdx-license-list-3.6 ] .
359
-
360
373
#### The ` metadata ` table (optional)
361
374
362
375
Cargo by default will warn about unused keys in ` Cargo.toml ` to assist in
@@ -946,4 +959,3 @@ dependencies][replace] section of the documentation.
946
959
[ `cargo test` ] : ../commands/cargo-test.md
947
960
[ spdx-2.1-license-expressions ] : https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60
948
961
[ spdx-license-list-3.6 ] : https://github.com/spdx/license-list-data/tree/v3.6
949
- [ spdx-license-list ] : https://spdx.org/licenses/
0 commit comments