#engine #org

yanked org-tangle-engine

A faster way to tangle org-mode. the engine of the commend line tool

9 releases

✓ Uses Rust 2018 edition

0.1.9 Oct 9, 2018
0.1.8 Oct 8, 2018
Download history 18/week @ 2018-11-10 10/week @ 2018-11-17 27/week @ 2018-11-24 22/week @ 2018-12-01 20/week @ 2018-12-08 53/week @ 2018-12-15 18/week @ 2018-12-22 1/week @ 2018-12-29 9/week @ 2019-01-05 3/week @ 2019-01-12 9/week @ 2019-01-19 2/week @ 2019-01-26 9/week @ 2019-02-16

129 downloads per month
Used in 7 crates (4 directly)

GPL-3.0 license

8KB
254 lines

tangle in rust

A collection of tools to do tangle in rust.

Getting Start

To build the program, nightly rust toolchain is needed.

rustup is the tool to help programmers install rust toolchains.

Then do:

rustup install nightly
cargo +nightly install tangle-cli --git https://github.com/xieyuheng/tangle-rs

org-mode

In a .org file

  • Add tangle property-line
#+property: tangle lib.rs
  • The following code block will be tangled into lib.rs
#+begin_src rust
fn tangle (string: &str) -> Result <String, TangleError> {
    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)
}
#+end_src

Note About Restriction on org-mode

  • The use case is restricted to global tangle property-line
    • code block level tangle property-line is NOT supported
    • headline level tangle property-line is NOT supported

Check out https://github.com/OrgTangle for alternative tangle support.

Markdown

In a .md file

  • Add tangle property-line
---
tangle: lib.rs
---
  • The following code block will be tangled into lib.rs
``` rust
fn tangle (string: &str) -> Result <String, TangleError> {
    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)
}
```

Contributing

We enforce C4 as collaboration protocol :

Code Of Conduct

License

No runtime deps