Skip to content

Run more complex code test cases using waltz #229

Open
@killercup

Description

@killercup

I've recently finished (what I consider) a usable version of waltz, a tool to extract code blocks from markdown and save them as files. This allows you to do something like literate programming with multiple files. (I wrote a bit about it here.)

I think this might be a nice addition to the rustdoc tests mdbook already supports. The main difference is that you need to specify a file name for the code block like this:

```rust,file=examples/foobar.rs
fn main() {
    println!("Hello world!");
}
```

This syntax is valid CommonMark and works on Github as well.

(You might also need to do some pre-processing to remove the leading of # some lines of code, if you support that kind of thing. waltz' main library function just takes an iterator of pulldown-cmark events, so this should be easy to do.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-TestsArea: `mbdook test` related testsC-enhancementCategory: Enhancement or feature requestS-ExperimentStatus: Experiment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions