From 6ae9459230f1f230bfeb5c15bb0a589ab53147ab Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 14 Aug 2017 21:45:23 +0100 Subject: [PATCH] Add pandoc skeleton code --- src/build/mod.rs | 9 +++++++++ src/build/pandoc.rs | 11 +++++++++++ src/main.rs | 2 ++ src/process.rs | 4 +++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/build/mod.rs create mode 100644 src/build/pandoc.rs diff --git a/src/build/mod.rs b/src/build/mod.rs new file mode 100644 index 0000000..a0629cd --- /dev/null +++ b/src/build/mod.rs @@ -0,0 +1,9 @@ +pub mod pandoc; + +use config::Config; + + +pub fn build_input(config: &Config, input: String) -> Result { + pandoc::render(&config, input); + return Ok("".into()); +} diff --git a/src/build/pandoc.rs b/src/build/pandoc.rs new file mode 100644 index 0000000..401201b --- /dev/null +++ b/src/build/pandoc.rs @@ -0,0 +1,11 @@ +use config::Config; +use pandoc::Pandoc; + +fn build_pandoc(config: &Config) -> Pandoc { + return Pandoc::new(); +} + + +pub fn render(config: &Config, input: String) { + let renderer = build_pandoc(config); +} diff --git a/src/main.rs b/src/main.rs index c2b180d..6f2b588 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ extern crate clap; extern crate serde_derive; extern crate serde_yaml; +extern crate pandoc; use std::io::{self, Write}; use std::process::exit; @@ -13,6 +14,7 @@ mod config; mod process; mod input; mod utils; +mod build; #[cfg(test)] mod tests; diff --git a/src/process.rs b/src/process.rs index 84fbfc0..1c84228 100644 --- a/src/process.rs +++ b/src/process.rs @@ -1,9 +1,11 @@ use input::read_input_files; use config::Config; +use build::build_input; pub fn build(config: Config) -> Result<(), String> { - let input = try!(read_input_files(config.input)); + let input = try!(read_input_files(config.input.clone())); println!("{}", input); + build_input(&config, input); return Ok(()); }