feat(parser): planning parsing

This commit is contained in:
PoiScript 2019-04-06 14:49:47 +08:00
parent 8bb7ae41d3
commit 406fd22aee
5 changed files with 103 additions and 14 deletions

View file

@ -1,14 +1,18 @@
#![allow(unused_variables)]
use crate::elements::Key;
use crate::headline::Headline;
use crate::objects::{Cookie, Timestamp};
use crate::parser::Parser;
use crate::{
elements::{Key, Planning},
headline::Headline,
objects::{Cookie, Timestamp},
parser::Parser,
};
use jetscii::ascii_chars;
use std::convert::From;
use std::fmt;
use std::io::{Error, Write};
use std::marker::PhantomData;
use std::{
convert::From,
fmt,
io::{Error, Write},
marker::PhantomData,
};
pub trait HtmlHandler<W: Write, E: From<Error>> {
fn headline_beg(&mut self, w: &mut W, hdl: Headline) -> Result<(), E> {
@ -216,6 +220,9 @@ pub trait HtmlHandler<W: Write, E: From<Error>> {
fn text(&mut self, w: &mut W, cont: &str) -> Result<(), E> {
Ok(write!(w, "{}", Escape(cont))?)
}
fn planning(&mut self, w: &mut W, planning: Planning) -> Result<(), E> {
Ok(())
}
}
pub struct DefaultHtmlHandler;