pnkfelix / tango

Markdown-based Literate programming in Rust, integrated with Cargo.
Apache License 2.0
171 stars 12 forks source link

Allow more flexible placement of Tango (sub)tree(s). #11

Open pnkfelix opened 7 years ago

pnkfelix commented 7 years ago

Currently Tango assumes that all .rs and .md files are underneath src/ in the current working directory.

This means that if you want Tango to run on only a subset of your files, you need to go through machinations like this (taken from https://github.com/pnkfelix/mon-artiste/commit/e7896eb4ff650089df5526f12e61745783752f50):

    env::set_current_dir(lit).unwrap();
    tango::process_root().unwrap();

(where lit is set up by reading env::current_dir and then pushing src/lit/.)

This is unfortunate, and there's no real good reason for it beyond laziness on my part. At the very least we could take inspiration from the lalrpop crate, which seems to provide both an easy fn process_root and then a more intricate entry point where one supplies a configuration.