# wild-doc ## Example ```rust use wild_doc::*; let dir="./wd-test/"; if std::path::Path::new(dir).exists(){ std::fs::remove_dir_all(dir).unwrap(); } std::fs::create_dir_all(dir).unwrap(); let mut wd = WildDoc::new(dir, Box::new(IncludeLocal::new("./include/")), None); let update_xml = br#" admin admin "#; wd.run(update_xml, b"").unwrap(); let r=wd.run(br#" : hoge : : : dep:@ "# ,b"" ).unwrap(); println!("{}", std::str::from_utf8(r.body()).unwrap()); let update_xml = br#""#; wd.run(update_xml, b"").unwrap(); //update data. /*wd.run(r#" Noah US Liam US Olivia UK "#,b"").unwrap();*/ let update_xml = br#" "#; wd.run( update_xml, br#"{ "name":"Noah" ,"from":"US" }"#, ) .unwrap(); wd.run( update_xml, br#"{ "name":"Liam" ,"from":"US" }"#, ) .unwrap(); wd.run( update_xml, br#"{ "name":"Olivia" ,"from":"UK" }"#, ) .unwrap(); //select data. let r=wd.run(br#"
find persons.
"#,b"").unwrap(); println!("{}", std::str::from_utf8(r.body()).unwrap()); //seaech data let r=wd.run(br#"
find persons from the US.
  • : :
"#,b"").unwrap(); println!("{}", std::str::from_utf8(r.body()).unwrap()); //use javascript let r=wd.run(br#"
find persons from the .
  • : :
"#,b"").unwrap(); println!( "{} : {:#?}", std::str::from_utf8(r.body()).unwrap(), r.options() ); //search in update section. let r=wd.run(br#" Renamed "#,b"").unwrap(); println!("{}", std::str::from_utf8(r.body()).unwrap()); let r=wd.run(br#"
find persons.
  • : :
"#,b"").unwrap(); println!("{}", std::str::from_utf8(r.body()).unwrap()); //use WebAPI let r = wd .run( br#" a: input: 2; ?> a: v: "#, br#"{ "name":"Ken" ,"from":"US" }"#, ) .unwrap(); println!( "{} : {:#?}", std::str::from_utf8(r.body()).unwrap(), r.options() ); ``` ## Include file ### layout.xml ```xml HTML include test ``` ### body.xml ```xml BODY ``` ### rust ```rust let r=wd.run(br#" "#,b""); println!("{}",r); ``` ### output ```html HTML include test BODY ``` ## Use python Specify features in Cargo.toml. ```toml wild-doc = { version = "x" , path = "../wild-doc" ,features=[ "js","py" ] } ``` ### code ```rust //use WebAPI let r=wd.run(br#""#,b"").unwrap(); ```