Closed noirotm closed 5 years ago
reducing code size. 🎉
as the documentation isn't that great compared to handlebars This is something I also ran into when I began, but I personally don't see how to fix this
I wish publish this to crates.io soon-ish, probably within 24 hours
Released 0.2.0 🎉
Also apparently cargo doesn't like it when you modify the lib.rs during a deploy:
error: failed to verify package tarball
Caused by:
Source directory was modified by build.rs during cargo publish. Build scripts should not modify anything outside of OUT_DIR.
Added: /home/trangar/development/rust/periodic_table/target/package/periodic_table-0.2.0/src/lib.rs
To proceed despite this, pass the `--no-verify` flag.
cargo doesn't like it when you modify the lib.rs during a deploy
This could be fixed by following https://doc.rust-lang.org/cargo/reference/build-scripts.html#case-study-code-generation.
Basically, we keep a simple lib.rs which reexports a module written in OUT_DIR
. Seems the cleanest thing to do.
I believe Askama itself writes the compiled template in that directory.
Gonna try this today.
Yes, I think so too. I have opened an issue for this: #7
This commit has the benefit of improving type safety, as well as reducing code size.
It has been a bit challenging to use Askama, as the documentation isn't that great compared to handlebars, especially regarding custom filters. For example, surprisingly,
{{ a|b }}
works, while{{ a | b }}
refuses to compile. It is also a little bit more rigid as templates need to be placed in a dedicated templates directory.In the end it works fine :smile: