Add pandoc skeleton code

This commit is contained in:
Jake Howard 2017-08-14 21:45:23 +01:00
parent 7d1c36fed0
commit 6ae9459230
Signed by: jake
GPG key ID: 57AFB45680EDD477
4 changed files with 25 additions and 1 deletions

9
src/build/mod.rs Normal file
View file

@ -0,0 +1,9 @@
pub mod pandoc;
use config::Config;
pub fn build_input(config: &Config, input: String) -> Result<String, String> {
pandoc::render(&config, input);
return Ok("".into());
}

11
src/build/pandoc.rs Normal file
View file

@ -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);
}

View file

@ -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;

View file

@ -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(());
}