blob: 0af47ba8e32a8fb8203c6e866d01f98abae2ddf1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
///http://docutils.sourceforge.net/docs/ref/doctree.html
///serves as AST
#[macro_use]
mod macro_util;
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;
#[test]
fn test_imperative() {
let mut doc = Document::default();
let mut title = Title::default();
title.append_child("Hi");
doc.append_child(title);
println!("{:?}", doc);
}
#[test]
fn test_descriptive() {
let doc = Document::with_children(vec![
Title::with_children(vec![
"Hi".into()
]).into()
]);
println!("{:?}", doc);
}
|