kev0960 / dojang Goto Github PK
View Code? Open in Web Editor NEWEJS ported for Rust
EJS ported for Rust
Hello kev0960, I like that this repo exists, but my knowledge lacks and could not implement it correctly.
Here the code i added:
println!("1111111111111111");
let mut dj = Dojang::new();
println!("22222222222222222222");
// Load files as template under /template/files/path.
dj.load("src/emails").unwrap();
println!("333333333333333");
// dj.add("src/emails/order_email.ejs".to_string()).unwrap();
dj.render("order_email.ejs", serde_json::json!({"data" : email_order})).unwrap();
println!("4444444444444444444");
let order_email_content = fs::read_to_string(&"src/emails/order_email.ejs")?;
This prints this:
1111111111111111
22222222222222222222
thread 'actix-rt|system:0|arbiter:0' panicked at 'Cannot add op to End; op ParenClose', /home/klala/.cargo/registry/src/github.com-1ecc6299db9ec823/dojang-0.1.6/src/expr.rs:86:18
The Error originates to dojang, but no idea why?
The Error is not clear.
Notes: After adding dojang this error is there, my suspicion is a have made a mistake on how to use dojang.
Another Question: How could i use the template as a string after using dojang, there is no documentation clear to this.
Thanks, i am newbie to Rust.
Can you add the error message that the template variable is not found
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.