Parse priority cookie and COMMENT from headlines.

This commit is contained in:
Tom Alexander
2023-09-08 15:43:13 -04:00
parent b32c21eb1d
commit c7c0deed74
4 changed files with 48 additions and 7 deletions

View File

@@ -2,6 +2,8 @@ use super::Element;
use super::Object;
use super::Source;
pub type PriorityCookie = u8;
#[derive(Debug)]
pub struct Document<'s> {
pub source: &'s str,
@@ -14,10 +16,12 @@ pub struct Heading<'s> {
pub source: &'s str,
pub stars: usize,
pub todo_keyword: Option<(TodoKeywordType, &'s str)>,
// TODO: add todo-type enum
pub priority_cookie: Option<PriorityCookie>,
pub title: Vec<Object<'s>>,
pub tags: Vec<&'s str>,
pub children: Vec<DocumentElement<'s>>,
pub is_comment: bool,
pub is_archived: bool,
}
#[derive(Debug)]

View File

@@ -7,6 +7,7 @@ mod source;
pub use document::Document;
pub use document::DocumentElement;
pub use document::Heading;
pub use document::PriorityCookie;
pub use document::Section;
pub use document::TodoKeywordType;
pub use element::Element;