diff options
Diffstat (limited to 'src/document_tree/mod.rs')
| -rw-r--r-- | src/document_tree/mod.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/document_tree/mod.rs b/src/document_tree/mod.rs new file mode 100644 index 0000000..868b9f8 --- /dev/null +++ b/src/document_tree/mod.rs @@ -0,0 +1,21 @@ +///http://docutils.sourceforge.net/docs/ref/doctree.html +///serves as AST + +pub mod elements; +pub mod element_categories; +pub mod extra_attributes; +pub mod attribute_types; + +use self::element_categories::StructuralSubElement; + +pub use self::elements::*; //Element,CommonAttributes, +pub use self::extra_attributes::ExtraAttributes; +pub use self::element_categories::HasChildren; + +#[derive(Default,Debug)] +pub struct Document { children: Vec<Box<StructuralSubElement>> } +impl HasChildren<StructuralSubElement> for Document { + fn add_child<R: Into<StructuralSubElement>>(&mut self, child: R) { + self.children.push(Box::new(child.into())); + } +} |
