diff options
| author | Philipp A | 2023-12-28 15:43:24 +0100 | 
|---|---|---|
| committer | GitHub | 2023-12-28 15:43:24 +0100 | 
| commit | 0f4f1a420cbcf263a9118ec9b288c95f1b59ade8 (patch) | |
| tree | 030abd05e8894e4e9c6775794f890180cf6c5e91 /document_tree/src/lib.rs | |
| parent | 38b1c488601cfc2479f02df555b135ef01aa5618 (diff) | |
| parent | 774dd4798aedc40b38c6480e9c47f34c482f12d0 (diff) | |
| download | rust-rst-0f4f1a420cbcf263a9118ec9b288c95f1b59ade8.tar.bz2 | |
Merge branch 'main' into allow-rst-to-read-from-stdin
Diffstat (limited to 'document_tree/src/lib.rs')
| -rw-r--r-- | document_tree/src/lib.rs | 74 | 
1 files changed, 38 insertions, 36 deletions
| diff --git a/document_tree/src/lib.rs b/document_tree/src/lib.rs index 9154725..4b34ea9 100644 --- a/document_tree/src/lib.rs +++ b/document_tree/src/lib.rs @@ -1,50 +1,52 @@ -#![recursion_limit="256"] +#![recursion_limit = "256"] -///http://docutils.sourceforge.net/docs/ref/doctree.html -///serves as AST +/// See [doctree][] reference. +/// Serves as AST. +/// +/// [doctree]: http://docutils.sourceforge.net/docs/ref/doctree.html  #[macro_use]  mod macro_util; -pub mod url; -pub mod elements; +pub mod attribute_types;  pub mod element_categories; +pub mod elements;  pub mod extra_attributes; -pub mod attribute_types; +pub mod url; +pub use self::element_categories::HasChildren;  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::*; -	use std::default::Default; - -	#[test] -	fn imperative() { -		let mut doc = Document::default(); -		let mut title = Title::default(); -		let url = "https://example.com/image.jpg".parse().unwrap(); -		let image = ImageInline::with_extra(extra_attributes::ImageInline::new(url)); -		title.append_child("Hi"); -		title.append_child(image); -		doc.append_child(title); - -		println!("{:?}", doc); -	} - -	#[test] -	fn descriptive() { -		let doc = Document::with_children(vec![ -			Title::with_children(vec![ -				"Hi".into(), -				ImageInline::with_extra(extra_attributes::ImageInline::new( -					"https://example.com/image.jpg".parse().unwrap() -				)).into(), -			]).into() -		]); - -		println!("{:?}", doc); -	} +    use super::*; +    use std::default::Default; + +    #[test] +    fn imperative() { +        let mut doc = Document::default(); +        let mut title = Title::default(); +        let url = "https://example.com/image.jpg".parse().unwrap(); +        let image = ImageInline::with_extra(extra_attributes::ImageInline::new(url)); +        title.append_child("Hi"); +        title.append_child(image); +        doc.append_child(title); + +        println!("{:?}", doc); +    } + +    #[test] +    fn descriptive() { +        let doc = Document::with_children(vec![Title::with_children(vec![ +            "Hi".into(), +            ImageInline::with_extra(extra_attributes::ImageInline::new( +                "https://example.com/image.jpg".parse().unwrap(), +            )) +            .into(), +        ]) +        .into()]); + +        println!("{:?}", doc); +    }  } | 
