chrobry_core/lib.rs
1#[macro_use]
2extern crate pest_derive;
3
4pub mod ast;
5pub mod parser;
6pub mod processor;
7
8use crate::parser::parse;
9use crate::processor::process;
10use std::collections::HashMap;
11
12pub fn generate<F>(
13 content: &str,
14 separator: &str,
15 variables: HashMap<String, String>,
16 on_import: F,
17) -> Result<String, String>
18where
19 F: FnMut(&str) -> Result<String, String>,
20{
21 let ast = parse(content)?;
22 process(&ast, separator, variables, on_import)
23}