oli-obk / rust-pandoc

Apache License 2.0
51 stars 29 forks source link

Support a builder approach #8

Closed chriskrycho closed 7 years ago

chriskrycho commented 7 years ago

Currently, configuring the pandoc item is something like this:

let pandoc = Pandoc::new();
pandoc.set_input(...);
pandoc.add_option(...);
pandoc.add_option(...);
pandoc.add_option(...);
pandoc.add_option(...);
pandoc.set_output(...)
let result = pandoc.execute();

It would be nice to use the builder pattern instead:

let result = Pandoc::new()
    .set_input(...)
    .add_option(...)
    .add_option(...)
    .add_option(...)
    .add_option(...)
    .set_output(...)
    .execute(...);