-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
This might be RFC-worthy.
What if you could tie several sequential doctests together so that they operate as a single code block, but you can still write narrative comments in between in a literal style? This could cut down on ignore
/no_run
code blocks as well as hidden lines at the same time.
Example
Here is an example of using mutable variables. First, let's make some bindings.
```rust
let a = 1;
let mut b = 2;
```
`a` can't be modified, but `b` can!
```rust,cont
// a += 1; // this would be an error!
b += 1;
```
Clicking the run button on either code block would open a playpen with all the code. Syntax up for debate.
mgeislerCentril and mgeisler
Metadata
Metadata
Assignees
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Projects
Status
No status