diff options
| author | Philipp A | 2019-12-26 23:01:00 +0100 |
|---|---|---|
| committer | Philipp A | 2019-12-26 23:36:48 +0100 |
| commit | a0e3c53758d526bb418c068bce1c99fa5a597ed3 (patch) | |
| tree | e640238b011a9ea7806ccccaf1a435e4b371a376 /document_tree/src/lib.rs | |
| parent | 7018f5d3c42f18b6c83f398db9f1915361a7c679 (diff) | |
| download | rust-rst-a0e3c53758d526bb418c068bce1c99fa5a597ed3.tar.bz2 | |
Split into smaller crates
Diffstat (limited to 'document_tree/src/lib.rs')
| -rw-r--r-- | document_tree/src/lib.rs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/document_tree/src/lib.rs b/document_tree/src/lib.rs new file mode 100644 index 0000000..324fc44 --- /dev/null +++ b/document_tree/src/lib.rs @@ -0,0 +1,43 @@ +#![recursion_limit="256"] + +///http://docutils.sourceforge.net/docs/ref/doctree.html +///serves as AST + +#[macro_use] +mod macro_util; + +pub mod url; +pub mod elements; +pub mod element_categories; +pub mod extra_attributes; +pub mod attribute_types; + +pub use self::elements::*; //Element,CommonAttributes,HasExtraAndChildren +pub use self::extra_attributes::ExtraAttributes; +pub use self::element_categories::HasChildren; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn imperative() { + let mut doc = Document::default(); + let mut title = Title::default(); + title.append_child("Hi"); + doc.append_child(title); + + println!("{:?}", doc); + } + + #[test] + fn descriptive() { + let doc = Document::with_children(vec![ + Title::with_children(vec![ + "Hi".into() + ]).into() + ]); + + println!("{:?}", doc); + } +} |
