Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ca8af3b

Browse files
committedSep 18, 2023
docs(unstable): Update script documentation
1 parent 2e2aa5c commit ca8af3b

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed
 

‎src/doc/src/reference/unstable.md

+8-23
Original file line numberDiff line numberDiff line change
@@ -1191,13 +1191,12 @@ fn main() {}
11911191
```
11921192

11931193
A user may optionally specify a manifest in a `cargo` code fence in a module-level comment, like:
1194-
```rust
1194+
````rust
11951195
#!/usr/bin/env -S cargo +nightly -Zscript
1196-
1197-
//! ```cargo
1198-
//! [dependencies]
1199-
//! clap = { version = "4.2", features = ["derive"] }
1200-
//! ```
1196+
```cargo
1197+
[dependencies]
1198+
clap = { version = "4.2", features = ["derive"] }
1199+
```
12011200

12021201
use clap::Parser;
12031202

@@ -1212,7 +1211,7 @@ fn main() {
12121211
let args = Args::parse();
12131212
println!("{:?}", args);
12141213
}
1215-
```
1214+
````
12161215

12171216
### Single-file packages
12181217

@@ -1225,22 +1224,8 @@ Single-file packages may be selected via `--manifest-path`, like
12251224
`cargo test --manifest-path foo.rs`. Unlike `Cargo.toml`, these files cannot be auto-discovered.
12261225

12271226
A single-file package may contain an embedded manifest. An embedded manifest
1228-
is stored using `TOML` in a markdown code-fence with `cargo` at the start of the
1229-
infostring inside a target-level doc-comment. It is an error to have multiple
1230-
`cargo` code fences in the target-level doc-comment. We can relax this later,
1231-
either merging the code fences or ignoring later code fences.
1232-
1233-
Supported forms of embedded manifest are:
1234-
``````rust
1235-
//! ```cargo
1236-
//! ```
1237-
``````
1238-
``````rust
1239-
/*!
1240-
* ```cargo
1241-
* ```
1242-
*/
1243-
``````
1227+
is stored using `TOML` in rust "frontmatter", a markdown code-fence with `cargo`
1228+
at the start of the infostring at the top of the file.
12441229

12451230
Inferred / defaulted manifest fields:
12461231
- `package.name = <slugified file stem>`

0 commit comments

Comments
 (0)
Please sign in to comment.