feat(elements): planning element

This commit is contained in:
PoiScript 2019-06-27 13:20:21 +08:00
parent 74fd77dba2
commit 2cba072245
10 changed files with 341 additions and 256 deletions

View file

@ -60,11 +60,9 @@ fn main() -> Result<(), MyError> {
eprintln!("Usage: {} <org-file>", args[0]);
} else {
let contents = String::from_utf8(fs::read(&args[1])?)?;
let mut org = Org::new(&contents);
let mut writer = Vec::new();
org.parse();
org.html(&mut writer, CustomHtmlHandler)?;
let mut writer = Vec::new();
Org::parse(&contents).html(&mut writer, CustomHtmlHandler)?;
println!("{}", String::from_utf8(writer)?);
}

View file

@ -11,9 +11,7 @@ fn main() -> Result<()> {
eprintln!("Usage: {} <org-file>", args[0]);
} else {
let contents = String::from_utf8(fs::read(&args[1])?).unwrap();
let mut org = Org::new(&contents);
org.parse();
println!("{}", to_string(&org).unwrap());
println!("{}", to_string(&Org::parse(&contents)).unwrap());
}
Ok(())
}