cargo-sync-rdme 0.8.0

Cargo subcommand to synchronize README with crate documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
# Configuration

You can customize the behavior of `cargo-sync-rdme` by adding the following section to `Cargo.toml`.

```toml
[package.metadata.cargo-sync-rdme]
extra-targets = "./docs/reference.md"

[package.metadata.cargo-sync-rdme.badge]
style = "for-the-badge"
badges = {
  maintenance = true,
  license = true,
}

[package.metadata.cargo-sync-rdme.rustdoc]
html-root-url = "<url>"
```

You can also define common configuration for all packages in a workspace by adding the following section to the workspace `Cargo.toml`.

```toml
[workspace.metadata.cargo-sync-rdme]
# ...
```

## Top-Level Table (`cargo-sync-rdme`)

You can configure `cargo-sync-rdme` in `Cargo.toml` under either `package.metadata` or `workspace.metadata`.

Examples below use `package.metadata`.

```toml
[package.metadata.cargo-sync-rdme]
extra-targets = "./docs/reference.md"
```

### `extra-targets`

Additional Markdown files to synchronize.

By default, `cargo sync-rdme` updates the package README specified by `package.readme`. The `extra-targets` option specifies additional Markdown files to synchronize.

Relative paths are resolved from the `Cargo.toml` file that declares `extra-targets`.

You can specify either a string or an array of strings.

* **Value type:** `string` or `[string]`
* **Default:** `[]` (no additional Markdown files are synchronized)
* **Examples:**

  * Specifying a single Markdown file:

    Configuration (`Cargo.toml`):

    ```toml
    [package.metadata.cargo-sync-rdme]
    extra-targets = "./docs/reference.md"
    ```

  * Specifying multiple Markdown files:

    Configuration (`Cargo.toml`):

    ```toml
    [package.metadata.cargo-sync-rdme]
    extra-targets = ["./docs/reference.md", "./docs/usage.md"]
    ```

## `[badge]`

The `badge` table configures the badges synchronized by `cargo-sync-rdme`.
It can be defined under either `package.metadata.cargo-sync-rdme` or `workspace.metadata.cargo-sync-rdme`:

* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.badge]
  style = "flat-square"
  badges = {
    maintenance = true,
    license = { link = "https://example.com/license" },
  }
  ```

  Markdown (before sync):

  ```markdown
  <!-- cargo-sync-rdme badge -->
  ```

  Markdown (after sync):

  ```markdown
  <!-- cargo-sync-rdme badge [[ -->
  [![Maintenance: actively-developed](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg?style=flat-square)](https://doc.rust-lang.org/cargo/reference/manifest.html#the-badges-section)
  [![License: MIT OR Apache-2.0](https://img.shields.io/crates/l/cargo-sync-rdme.svg?style=flat-square)](https://example.com/license)
  <!-- cargo-sync-rdme ]] -->
  ```

Badges are output in the order in which the configuration items are written.

### `badge.style`

The `style` option specifies the badge style to use.

* **Value type:** `string`
* **Default:** none (no style is specified)
* **Possible values:**

  | Configuration           | Output                                                                                             |
  | ----------------------- | -------------------------------------------------------------------------------------------------- |
  | Not specified (default) | ![none]https://img.shields.io/badge/style-none-green.svg                                         |
  | `style="flat"`          | ![flat]https://img.shields.io/badge/style-flat-green.svg?style=flat                              |
  | `style="flat-square"`   | ![flat-square]https://img.shields.io/badge/style-flat--square-green.svg?style=flat-square        |
  | `style="for-the-badge"` | ![for-the-badge]https://img.shields.io/badge/style-for--the--badge-green.svg?style=for-the-badge |
  | `style="plastic"`       | ![plastic]https://img.shields.io/badge/style-plastic-green.svg?style=plastic                     |
  | `style="social"`        | ![social]https://img.shields.io/badge/style-social-green.svg?style=social                        |

### `badge.badges` / `badge.badges-<group-name>`

Defines badge groups.

`badge.badges` defines the default badge group.
In the Markdown file, `<!-- cargo-sync-rdme badge -->` is replaced with the badges in that group.

`badge.badges-<group-name>` defines a named badge group.
`<group-name>` must match `[A-Za-z][-_A-Za-z0-9]*`.
In the Markdown file, `<!-- cargo-sync-rdme badge:<group-name> -->` is replaced with the badges in the corresponding group.

`<key> = <value>` entries in a badge group table define the badges to output.
`<key>` indicates the badge kind, and `<value>` is the badge configuration.
See the [Badge items](#badge-items) section for details about the available badge kinds and their configuration.
If you want to output the same badge kind more than once, add a unique hyphenated suffix to make each table entry distinct, such as `maintenance-foo = true`.

Badges are output in the order in which the configuration items are written.

* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.badge]
  style = "flat-square"

  # Default badge group
  badges = {
    maintenance = true,
  }

  # `foo` badge group
  badges-foo = {
    license = true,
  }

  # `bar` badge group
  badges-bar = {
    github-actions-ci = { workflows = "ci.yml" },
    github-actions-cd = { workflows = "cd.yml" },
  }
  ```

  Markdown (before sync):

  ```markdown
  <!-- cargo-sync-rdme badge -->
  <!-- cargo-sync-rdme badge:foo -->
  <!-- cargo-sync-rdme badge:bar -->
  ```

  Markdown (after sync):

  ```markdown
  <!-- cargo-sync-rdme badge [[ -->
  [![Maintenance: actively-developed](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg?style=flat-square)](https://doc.rust-lang.org/cargo/reference/manifest.html#the-badges-section)
  <!-- cargo-sync-rdme ]] -->

  <!-- cargo-sync-rdme badge:foo [[ -->
  ![License: MIT OR Apache-2.0](https://img.shields.io/crates/l/cargo-sync-rdme.svg?style=flat-square)
  <!-- cargo-sync-rdme ]] -->

  <!-- cargo-sync-rdme badge:bar [[ -->
  [![GitHub Actions: CI](https://img.shields.io/github/actions/workflow/status/gifnksm/cargo-sync-rdme/ci.yml.svg?label=CI&logo=github&style=flat-square)](https://github.com/gifnksm/cargo-sync-rdme/actions/workflows/ci.yml)
  [![GitHub Actions: CD](https://img.shields.io/github/actions/workflow/status/gifnksm/cargo-sync-rdme/cd.yml.svg?label=CD&logo=github&style=flat-square)](https://github.com/gifnksm/cargo-sync-rdme/actions/workflows/cd.yml)
  <!-- cargo-sync-rdme ]] -->
  ```

## Badge Items

The following configuration items are available for badges:

### Maintenance Status

<!-- cargo-sync-rdme badge:maintenance [[ -->
[![Maintenance: actively-developed](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg?style=flat-square)](https://doc.rust-lang.org/cargo/reference/manifest.html#the-badges-section)
<!-- cargo-sync-rdme ]] -->

A badge indicating the maintenance status of the package.

The badge is generated from the `package.metadata.maintenance.status` field in `Cargo.toml`
(see [the cargo documentation](https://doc.rust-lang.org/cargo/reference/manifest.html#the-badges-section) for details).

The link target of the badge is set to <https://doc.rust-lang.org/cargo/reference/manifest.html#the-badges-section>.

* **Value type:** `boolean`
* **Default:** `false` (no maintenance status badge is output)
* **Possible values:**
  * `true`: Output a maintenance status badge
  * `false` (default): Do not output a maintenance status badge
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.badge]
  badges = { maintenance = true }
  ```

### License

<!-- cargo-sync-rdme badge:license [[ -->
![License: MIT OR Apache-2.0](https://img.shields.io/crates/l/cargo-sync-rdme.svg?style=flat-square)
<!-- cargo-sync-rdme ]] -->

A badge indicating the license of the package.

The badge is generated from the `package.license` field or `package.license-file` field in `Cargo.toml`
(see [the cargo documentation](https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields) for details).

The link target of the badge is determined by the badge configuration.

* **Value type:** `boolean` or `table`
* **Default:** `false` (no license badge is output)
* **Possible values:**
  * `{ link = "<link>" }`: Output a license badge. The link target of the badge is set to `<link>`
  * `true`: Output a license badge
    * If `package.license-file` is specified, the link target of the badge is set to the license file
    * If `package.license` is specified, no link is set
  * `false` (default): Do not output a license badge
* **Examples:**

  * Output a license badge using the default link behavior:

    Configuration (`Cargo.toml`):

    ```toml
    [package.metadata.cargo-sync-rdme.badge]
    badges = {
      license = true,
    }
    ```

  * Output a license badge with a link to the specified URL:

    Configuration (`Cargo.toml`):

    ```toml
    [package.metadata.cargo-sync-rdme.badge]
    badges = {
      license = { link = "https://opensource.org/licenses/MIT" },
    }
    ```

### Crates.io

<!-- cargo-sync-rdme badge:crates-io [[ -->
[![crates.io](https://img.shields.io/crates/v/cargo-sync-rdme.svg?logo=rust&style=flat-square)](https://crates.io/crates/cargo-sync-rdme)
<!-- cargo-sync-rdme ]] -->

A badge indicating the version of the package on crates.io.

The badge is generated from the `package.name` field in `Cargo.toml`
(see [the cargo documentation](https://doc.rust-lang.org/cargo/reference/manifest.html#the-name-field) for details).

The link target of the badge is set to `https://crates.io/crates/<package name>`.

* **Value type:** `boolean`
* **Default:** `false` (no crates.io badge is output)
* **Possible values:**
  * `true`: Output a crates.io badge
  * `false` (default): Do not output a crates.io badge
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.badge]
  badges = {
    crates-io = true,
  }
  ```

### Docs.rs

<!-- cargo-sync-rdme badge:docs-rs [[ -->
[![docs.rs](https://img.shields.io/docsrs/cargo-sync-rdme.svg?logo=docs.rs&style=flat-square)](https://docs.rs/cargo-sync-rdme)
<!-- cargo-sync-rdme ]] -->

A badge indicating the documentation build status of the package on docs.rs.

The badge is generated from the `package.name` field in `Cargo.toml`
(see [the cargo documentation](https://doc.rust-lang.org/cargo/reference/manifest.html#the-name-field) for details).

The link target of the badge is set to `https://docs.rs/<package name>`.

* **Value type:** `boolean`
* **Default:** `false` (no docs.rs badge is output)
* **Possible values:**
  * `true`: Output a docs.rs badge
  * `false` (default): Do not output a docs.rs badge
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.badge]
  badges = {
    docs-rs = true,
  }
  ```

### Rust Version (MSRV)

<!-- cargo-sync-rdme badge:rust-version [[ -->
[![Rust: ^1.98.0](https://img.shields.io/badge/rust-^1.98.0-93450a.svg?logo=rust&style=flat-square)](https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field)
<!-- cargo-sync-rdme ]] -->

A badge indicating the minimum supported Rust version (MSRV) of the package.

The badge is generated from the `package.rust-version` field in `Cargo.toml`
(see [the cargo documentation](https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field) for details).

The link target of the badge is set to <https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field>.

* **Value type:** `boolean`
* **Default:** `false` (no rust version badge is output)
* **Possible values:**
  * `true`: Output a rust version badge
  * `false` (default): Do not output a rust version badge
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.badge]
  badges = {
    rust-version = true,
  }
  ```

### GitHub Actions

<!-- cargo-sync-rdme badge:github-actions [[ -->
[![GitHub Actions: CD](https://img.shields.io/github/actions/workflow/status/gifnksm/cargo-sync-rdme/cd.yml.svg?label=CD&logo=github&style=flat-square)](https://github.com/gifnksm/cargo-sync-rdme/actions/workflows/cd.yml)
[![GitHub Actions: CI](https://img.shields.io/github/actions/workflow/status/gifnksm/cargo-sync-rdme/ci.yml.svg?label=CI&logo=github&style=flat-square)](https://github.com/gifnksm/cargo-sync-rdme/actions/workflows/ci.yml)
[![GitHub Actions: Deploy Rustdoc to GitHub Pages](https://img.shields.io/github/actions/workflow/status/gifnksm/cargo-sync-rdme/pages.yml.svg?label=Deploy+Rustdoc+to+GitHub+Pages&logo=github&style=flat-square)](https://github.com/gifnksm/cargo-sync-rdme/actions/workflows/pages.yml)
[![GitHub Actions: Renovate Post Update](https://img.shields.io/github/actions/workflow/status/gifnksm/cargo-sync-rdme/renovate-post-update.yml.svg?label=Renovate+Post+Update&logo=github&style=flat-square)](https://github.com/gifnksm/cargo-sync-rdme/actions/workflows/renovate-post-update.yml)
[![GitHub Actions: Security Audit](https://img.shields.io/github/actions/workflow/status/gifnksm/cargo-sync-rdme/audit.yml.svg?label=Security+Audit&logo=github&style=flat-square)](https://github.com/gifnksm/cargo-sync-rdme/actions/workflows/audit.yml)
<!-- cargo-sync-rdme ]] -->

One or more badges indicating the status of GitHub Actions workflows.

Badges are generated from the configured workflows.

Each badge links to `<package.repository>/actions/workflows/<file>`.
`<file>` is the name of a file in the `.github/workflows` directory.

* **Value type:** `boolean` or `table`
* **Default:** `false` (no GitHub Actions badge is output)
* **Possible values:**
  * `{ workflows = [ { file = "<file>", name = "<name>" } ] }`:
    Output GitHub Actions status badges.

    The link target of the badge is set to `<package.repository>/actions/workflows/<file>`.

    The array can contain multiple workflow objects.

    `<name>` is used as the badge name.
    If `<name>` is not specified, the name of the workflow defined in the `<file>` is used as the badge name.
  * `{ workflows = [ "<file>" ] }` and `{ workflows = "<file>" }`:
    Same as `{ workflows = [ { file = "<file>" } ] }`
  * `{ workflows = [] }`:
    Output GitHub Actions status badges for all workflows in the `.github/workflows` directory.
  * `true`: Same as `github-actions = { workflows = [] }`
  * `false` (default): Do not output a GitHub Actions status badge
* **Examples:**

  * Output all GitHub Actions workflow statuses:

    Configuration (`Cargo.toml`):

    ```toml
    [package.metadata.cargo-sync-rdme.badge]
    badges = {
      github-actions = true,
    }
    ```

  * Output specified GitHub Actions workflow statuses:

    Configuration (`Cargo.toml`):

    ```toml
    [package.metadata.cargo-sync-rdme.badge]
    badges = {
      github-actions = {
        workflows = ["ci.yml", "cd.yml"],
      },
    }
    ```

### Codecov

<!-- cargo-sync-rdme badge:codecov [[ -->
[![Codecov](https://img.shields.io/codecov/c/github/gifnksm/cargo-sync-rdme.svg?label=codecov&logo=codecov&style=flat-square)](https://codecov.io/gh/gifnksm/cargo-sync-rdme)
<!-- cargo-sync-rdme ]] -->

A badge indicating the coverage of the package.

The badge is generated from the `package.repository` field in `Cargo.toml`
(see [the cargo documentation](https://doc.rust-lang.org/cargo/reference/manifest.html#the-repository-field) for details).

The link target of the badge is set to `https://codecov.io/gh/<repository_path>/`.

* **Value type:** `boolean` or `table`
* **Default:** `false` (no Codecov badge is output)
* **Possible values:**
  * `{ ... }`: Output a Codecov badge with the following additional options
    * `component = "<component>"`: Add the `component=<component>` query parameter to the badge image URL
    * `flag = "<flag>"`: Add the `flag=<flag>` query parameter to the badge image URL
  * `true`: Output a Codecov badge with default configuration
  * `false` (default): Do not output a Codecov badge
* **Examples:**

  * Output Codecov badge with default configuration:

    Configuration (`Cargo.toml`):

    ```toml
    [package.metadata.cargo-sync-rdme.badge]
    badges = {
      codecov = true,
    }
    ```

  * Output a Codecov badge with a component and a flag:

    Configuration (`Cargo.toml`):

    ```toml
    [package.metadata.cargo-sync-rdme.badge]
    badges = {
      codecov = {
        component = "cli",
        flag = "integration-test",
      },
    }
    ```

## `[rustdoc]`

The `rustdoc` table configures the crate documentation synchronized by `cargo-sync-rdme`.
It can be defined under either `package.metadata.cargo-sync-rdme` or `workspace.metadata.cargo-sync-rdme`.

* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.rustdoc]
  toolchain = "nightly"
  features = ["feature1", "feature2"]
  all-features = true
  no-default-features = true
  standard-library-url-mode = "channel"
  html-root-url = "<url>"
  mappings = { "<target>" = "<url>" }
  ```

  Markdown (before sync):

  ```markdown
  <!-- cargo-sync-rdme rustdoc -->
  ```

  Markdown (after sync):

  ```markdown
  <!-- cargo-sync-rdme rustdoc [[ -->
  (synchronized rustdoc output)
  <!-- cargo-sync-rdme ]] -->
  ```

The following configuration items are available for rustdoc:

### `rustdoc.toolchain`

Set the toolchain to use for `rustdoc`.

You can override this default with the `--toolchain` command line option.

* **Value type:** `string`
* **Default:** the toolchain used to run `cargo sync-rdme` (or the default toolchain, if you run `cargo-sync-rdme` directly)
* **Possible values:** any valid toolchain name accepted by `rustup run <toolchain> cargo rustdoc`, such as `stable`, `beta`, `nightly`, `1.98.1`, or `1.98.1-x86_64-unknown-linux-gnu`.
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.rustdoc]
  toolchain = "nightly"
  ```

### `rustdoc.features`

Set the default feature flags to pass to `cargo rustdoc` when generating the crate documentation.

You can override these defaults with the `--features` command line options.

* **Value type:** `[string]`
* **Default:** `[]` (no feature flags are passed to `cargo rustdoc`)
* **Possible values:** array of any valid feature name defined in the crate's `Cargo.toml`.
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.rustdoc]
  features = ["feature1", "feature2"]
  ```

### `rustdoc.all-features`

Whether to pass `--all-features` to `cargo rustdoc`.

You can also enable this with the `--all-features` command line option.

* **Value type:** `boolean`
* **Default:** `false` (do not pass `--all-features` to `cargo rustdoc`)
* **Possible values:**
  * `true`: pass `--all-features` to `cargo rustdoc`
  * `false` (default): do not pass `--all-features` to `cargo rustdoc`
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.rustdoc]
  all-features = true
  ```

### `rustdoc.no-default-features`

Whether to pass `--no-default-features` to `cargo rustdoc`.

You can also enable this with the `--no-default-features` command line option.

* **Value type:** `boolean`
* **Default:** `false` (do not pass `--no-default-features` to `cargo rustdoc`)
* **Possible values:**
  * `true`: pass `--no-default-features` to `cargo rustdoc`
  * `false` (default): do not pass `--no-default-features` to `cargo rustdoc`
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.rustdoc]
  no-default-features = true
  ```

### `rustdoc.standard-library-url-mode`

Control how links to Rust standard library items hosted on <https://doc.rust-lang.org> are rewritten.

This affects generated links to items in crates such as `std`, `core`, and `alloc`.

This option only rewrites URLs under <https://doc.rust-lang.org/>.
Other URLs are left unchanged.

This is most useful when `rustdoc.toolchain` or `--toolchain` selects a different toolchain for `rustdoc` than the toolchain used to run `cargo sync-rdme`.
When `rustdoc` runs with a nightly toolchain, it emits nightly standard library API reference URLs.

This option rewrites only the toolchain name part of those URLs, such as `nightly`, to match the selected channel or version.
If the path of a standard library item differs between toolchains, the rewritten link may be invalid.
To override a specific intra-doc link target, add an entry to `rustdoc.mappings`.

* **Value type:** `string`
* **Default:** `channel`
* **Possible values:**
  * `channel` (default): rewrite the URL to the release channel of the toolchain used to run `cargo sync-rdme` (`stable`, `beta`, or `nightly`).
  * `version`: rewrite the URL to the versioned documentation for the toolchain used to run `cargo sync-rdme`.
    Versioned documentation is not published for beta or nightly, so those channels use `beta` or `nightly` URLs instead.
  * `as-is`: keep the URL emitted by `rustdoc`.
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.rustdoc]
  standard-library-url-mode = "version"
  ```

  Source code (`src/lib.rs`):

  ```rust
  //! [`std::vec::Vec`]
  ```

  Markdown (after sync):

  ```markdown
  <!-- cargo-sync-rdme rustdoc [[ -->
  [`std::vec::Vec`]

  [`std::vec::Vec`]: https://doc.rust-lang.org/1.98.1/std/vec/struct.Vec.html "struct std::vec::Vec"
  <!-- cargo-sync-rdme ]] -->
  ```

  For example, if you run `cargo sync-rdme` on stable `1.98.1` but select a nightly toolchain for `rustdoc`, the generated link becomes:

  | `rustdoc.standard-library-url-mode` | Generated link for `std::vec::Vec`                          |
  | ----------------------------------- | ----------------------------------------------------------- |
  | `channel` (default)                 | <https://doc.rust-lang.org/stable/std/vec/struct.Vec.html>  |
  | `version`                           | <https://doc.rust-lang.org/1.98.1/std/vec/struct.Vec.html>  |
  | `as-is`                             | <https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html> |

### `rustdoc.html-root-url`

Set the root URL used for links into the package documentation.

If you host the documentation on GitHub Pages, you can set the value to `https://<user>.github.io/<repository>/`.

* **Value type:** `string`
* **Default:** `https://docs.rs/<package name>/<package version>`
* **Possible values:** any valid URL.
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.rustdoc]
  html-root-url = "https://<user>.github.io/awesome-library/"
  ```

  Source code (`src/lib.rs`):

  ```rust
  //! This crate provides [`AwesomeType`].

  /// This is an awesome type.
  struct AwesomeType;
  ```

  Markdown (after sync):

  ```markdown
  <!-- cargo-sync-rdme rustdoc [[ -->
  This crate provides [`AwesomeType`].

  [`AwesomeType`]: https://<user>.github.io/awesome-library/awesome_library/struct.AwesomeType.html "struct awesome_library::AwesomeType"
  <!-- cargo-sync-rdme ]] -->
  ```

### `rustdoc.mappings`

Override rustdoc intra-doc link resolution for specific link targets.

A mapping of the form `{ <target> = "<url>" }` resolves the intra-doc link target `<target>` to `<url>`.

`<target>` must exactly match the intra-doc link target as written in the rustdoc source.
If you use intra-doc link shorthands such as ``[`foo`]``, the mapping key must include the backticks (for example, ``"`foo`" = "https://example.com/"``).

This is useful when the `cargo-sync-rdme` output contains incorrect links.

* **Value type:** `{ <target> = "<url>" }`
* **Default:** `{}` (no mappings are provided)
* **Possible values:** any mapping from an intra-doc link target to a URL.
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.rustdoc]
  mappings = {
    "`SomeType`" = "https://example.com/docs/struct.SomeType.html",
  }
  ```

  Source code (`src/lib.rs`):

  ```rust
  //! This crate provides [`SomeType`].

  /// This is some type.
  struct SomeType;
  ```

  Markdown (after sync):

  ```markdown
  <!-- cargo-sync-rdme rustdoc [[ -->
  This crate provides [`SomeType`].

  [`SomeType`]: https://example.com/docs/struct.SomeType.html
  <!-- cargo-sync-rdme ]] -->
  ```

### `rustdoc.rustdoc-args`

Additional `RUSTDOCFLAGS` to set.

* **Value type:** `[string]`
* **Default:** `[]` (no additional arguments)
* **Possible values:** any arguments that `rustdoc` accepts
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.rustdoc]
  rustdoc-args = ["--extern-html-root-takes-precedence", "--cfg=docsrs"]
  ```

### `rustdoc.cargo-args`

Additional command line arguments for `cargo rustdoc`.

* **Value type:** `[string]`
* **Default:** `[]` (no additional arguments)
* **Possible values:** any arguments that `cargo rustdoc` accepts
* **Examples:**

  Configuration (`Cargo.toml`):

  ```toml
  [package.metadata.cargo-sync-rdme.rustdoc]
  cargo-args = ["-Zrustdoc-scrape-examples"]
  ```