Skip to content

Commit 3b2d1d6

Browse files
committed
docs(unstable): Update script documentation
1 parent 514122e commit 3b2d1d6

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

src/doc/src/reference/unstable.md

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,13 +1477,12 @@ fn main() {}
14771477
```
14781478

14791479
A user may optionally specify a manifest in a `cargo` code fence in a module-level comment, like:
1480-
```rust
1480+
````rust
14811481
#!/usr/bin/env -S cargo +nightly -Zscript
1482-
1483-
//! ```cargo
1484-
//! [dependencies]
1485-
//! clap = { version = "4.2", features = ["derive"] }
1486-
//! ```
1482+
```cargo
1483+
[dependencies]
1484+
clap = { version = "4.2", features = ["derive"] }
1485+
```
14871486

14881487
use clap::Parser;
14891488

@@ -1498,7 +1497,7 @@ fn main() {
14981497
let args = Args::parse();
14991498
println!("{:?}", args);
15001499
}
1501-
```
1500+
````
15021501

15031502
### Single-file packages
15041503

@@ -1511,22 +1510,8 @@ Single-file packages may be selected via `--manifest-path`, like
15111510
`cargo test --manifest-path foo.rs`. Unlike `Cargo.toml`, these files cannot be auto-discovered.
15121511
15131512
A single-file package may contain an embedded manifest. An embedded manifest
1514-
is stored using `TOML` in a markdown code-fence with `cargo` at the start of the
1515-
infostring inside a target-level doc-comment. It is an error to have multiple
1516-
`cargo` code fences in the target-level doc-comment. We can relax this later,
1517-
either merging the code fences or ignoring later code fences.
1518-
1519-
Supported forms of embedded manifest are:
1520-
``````rust
1521-
//! ```cargo
1522-
//! ```
1523-
``````
1524-
``````rust
1525-
/*!
1526-
* ```cargo
1527-
* ```
1528-
*/
1529-
``````
1513+
is stored using `TOML` in rust "frontmatter", a markdown code-fence with `cargo`
1514+
at the start of the infostring at the top of the file.
15301515
15311516
Inferred / defaulted manifest fields:
15321517
- `package.name = <slugified file stem>`

0 commit comments

Comments
 (0)