Function svg_simple_parser::stringify[][src]

pub fn stringify(ele: Rc<RefCell<Element<'_>>>) -> String
Expand description

transform a Element(AST struct) to svg

return string.

Example

use svg_simple_parser::{Element,stringify};

let root = Element::new_width_children((
  "rect",
  std::collections::HashMap::from([
    ("width".to_owned(),"100"),
  ]),
  vec![
    Element::new_width_children((
      "rect",
      std::collections::HashMap::from([
        ("width".to_owned(),"100"),
      ]),
      vec![],
    )),
  ],
));
let svg = stringify(root);
println!("{:#?}", svg);