A command line tool to tangle code blocks in md file to source code file.
To build the program, nightly rust toolchain is needed.
rustup
is the tool to help programmers install rust toolchains.
- One can get rustup from :: https://rustup.rs
Then do:
rustup install nightly
cargo +nightly install md-tangle
``` USAGE: md-tangle [FLAGS] [PATH]...
FLAGS: -r, --recursive recursively traverse
ARGS:
.md
files
ignore .md
files without tangle property
```
In file engine.md
```
lib.rs
``` rust
fn tangle (string: &str) -> Result {
let mut result = String::new ();
let mut lines = string.lines ();
while let Some (line) = lines.next () {
if block_begin_line_p (line) {
tangle_collect (&mut result, &mut lines)?;
}
}
Ok (result)
}
```
engine.md
is tangled to lib.rs