feat(parser): planning parsing
This commit is contained in:
parent
8bb7ae41d3
commit
406fd22aee
5 changed files with 103 additions and 14 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ macro_rules! handle_event {
|
|||
ListItemBeg { bullet } => $handler.list_beg_item($writer, bullet)?,
|
||||
ListItemEnd => $handler.list_end_item($writer)?,
|
||||
Call { value } => $handler.call($writer, value)?,
|
||||
Planning(p) => $handler.planning($writer, p)?,
|
||||
Clock => $handler.clock($writer)?,
|
||||
Timestamp(t) => $handler.timestamp($writer, t)?,
|
||||
Comment(c) => $handler.comment($writer, c)?,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue