kaj/ructe

Rust Compiled Templates — ructe

This is my attempt at writing a HTML template system for Rust

Rust Compiled Templates — ructe

This is my attempt at writing a HTML template system for Rust. Some inspiration comes from the scala template system used in play 2, as well as plain old jsp.

Design criteria

  • As many errors as possible should be caught at compile-time.
  • A compiled binary should include all the template code it needs, no need to read template files at runtime.
  • Compilation may take time, running should be fast.
  • Writing templates should be almost as easy as writing html.
  • The template language should be as expressive as possible.
  • It should be possible to write templates for any text-like format, not only html.
  • Any value that implements the Display trait should be outputable.
  • By default, all values should be html-escaped. There should be an easy but explicit way to output preformatted html.

Current status

Ructes is in a rather early stage, but does work; templates can be transpiled to rust functions, which are then compiled and can be called from rust code.

Template format

A template consists of three basic parts: First a preamble of use statements, each prepended by an @ sign. Secondly a declaration of the parameters the template takes. And third, the template body.

The full syntax is described in the documentation. Some examples can be seen in examples/simple/templates. A template may look something like this:

How to use ructe

Ructe compiles your templates to rust code that should be compiled with your other rust code, so it needs to be called before compiling, as described in the documentation. There are also examples, both for ructe itself and its futures and for using it with the web frameworks actix-web, gotham, iron, nickel, tide, and warp. There is also a separate example of using ructe with warp and diesel.

Issues

Collection of the latest Issues

kornelski

kornelski

Comment Icon4

I've used to pass &mut dyn Write to the templates, but it does not compile any more due to <W> bound on template functions lacking ?Sized.

LittleEntity

LittleEntity

Comment Icon2

I try to match the following enum with internal struct variants

with

The error message is:

this works:

In rust this works:

Am I doing something wrong? Is this a defect of the library?

I enjoy using ructe 🦀 thankyou for sharing 🙏

gpluscb

gpluscb

Comment Icon1

It would be nice if templates could be rendered without using build scripts. The current approach is not very bad, but it could be more ergonomic with macros.

The pro for using macros is that special build scripts would be unnecessary, and this crate would no longer need "special treatment" to set up. It might also be friendlier for development tools, but I am not entirely sure on this point.

The con is that, as far as I understand, this would require setting up another ructe-codegen crate that hosts the procedural macro(s). This might also require exposing some previously private apis in altered form.

For what an api using macros could look like, something like this comes to mind:

At least naively implemented, this has the disadvantage that templates will need to be parsed once for every use of that template. Also having so many arguments is just not very pretty or readable.

Alternatively, something like

might be worth considering even though it is imo less intuitive because the macro looks more like a function call than a function definition.

where template! returns an instance of some struct generated from within the macro might also work.

As you can tell, this idea is not very fleshed out yet, but I believe it has a lot of potential in making the library easier to use, and I would love to hear ideas and opinions on the matter.

OskarPersson

OskarPersson

enhancement
Comment Icon3

How can I join a vector of html strings with a custom separator? With for exampe Vec<String> I would use join but this isn't available for Html. This is what I've tried:

Aedius

Aedius

bug
Comment Icon1

In the function add_static, the variable rust_name start with the name of the file, so it breaks.

It's not a big deal, but i thing it's worth mentioning.

OskarPersson

OskarPersson

Comment Icon1

Is there something similar to Django's with tag to store result of complex or expensive methods for use in the template multiple times?

Aunmag

Aunmag

Comment Icon4

It would be cool if this template might produce something like:

But to get the same output I have to write the template in this way, and it looks kinda dirty:

So the point is: if a line contains only start or end of an expression, and while spaces or tabs or line-break, then it will be skipped. It will allow to write more readable and intuitive templates.

More examples:

The first one looks better, doesn't it? :)

I hope you will take more attention to Rocker developer's experience, 'cause we need such a great tool in Rust too.

bhansconnect

bhansconnect

help wanted
Comment Icon1

It would be great if at some point ructe directly supported Rocket. It is a really nice rust web engine that is growing in popularity.

kornelski

kornelski

enhancement
Comment Icon5

I have a couple of places in HTML where I want to prevent any extra whitespace in the generated output:

  • When generating multiple inline or inline-block elements that shouldn't have gaps created by spaces.
  • When inserting commas or periods after elements, since a space before punctuation marks is generally inappropriate typographically.

Currently I'm just writing templates without spaces in them, but this isn't very convenient, since it requires use of long lines, and careful avoidance of any spaces.

So ideally I'd like some kind of block/directive that allows me to write template source with line breaks and indentation as usual, but remove that whitespace from the output.

I'm not sure what the syntax for it should look like, but generally template languages have blocks that either ignore all whitespace around elements, or trim whitespace at beginning and end of every line.

aep

aep

enhancement
Comment Icon13

why do the template files have to end in .html?

ConnyOnny

ConnyOnny

Comment Icon2

You already mentioned that you need different escaping for different languages to template. However with the web it's way worse, because you have different languages in one file. Escaping is different for html code in an html file, than for css code in that same html file, javascript code in that same html file, a string constant in javascript code in that html file. Let the programmer (a typical web designer) choose their poison -- ehrm escaping function and they will make mistakes. This leads to exploits which are already out there in millions. Rust is supposed to be secure, right?

From a templating engine written in Rust in 2016 one expects no less than a safety guarantee, that all strings are well-escaped regarding their context. This is not as easy as it may sound. I see two ways to do this.

  1. While writing the template, have a parser running in the background, which keeps track, which context the writer is currently in. I believe, the Servo people should have something like that lying around. This would be a dynamically enforced guarantee.
  2. The AST of the template without the insertions is parsed at compile-time, and so for each insertion, the context is already known statically. The problem with that is, that you can't modify the AST anymore without telling ructe (e.g. no pasting of a pre-html-formatted article text), because it could invalidate ructe's assumption about the context we're supposed to be in. Or it could be allowed, if you write unsafe around it. Or the html strings could be parsed dynamically and checked for closedness in the given static context (i.e. the original context is restored after the string). Closedness results for commonly used strings (frequently-accessed article html code from a database) could be cached to avoid running the parser on every execution.

Sadly, of course the client's browser could use a non-standard parser and build up a completely different AST, in which case (s)he will not be protected. But in 2016, with all the web standards we have, this should be a very rare case.

What are your thoughts?

Versions

Find the latest versions by id

v0.14.0 - Feb 06, 2022

  • Breaking change: The generated template functions have a simpler signature.
  • Allow litetimes in template argument types. Issue #106, PR #110.
  • Improve error handling in optional warp support, PR #109.
  • Current stable rust is 1.57, MSRV is now 1.46.0.
  • Update nom dependency to 7.1.0.
  • Update optional rsass to 0.23.0.
  • Update env_logger to 0.9 and gotham to 0.7.1 in examples
  • Dropped support for warp 0.2 (the warp02 feature and example).

Thanks to @JojiiOfficial for reporting #106.

v0.13.4 - Jun 25, 2021

2021-06-25.

  • Allow else if after an @if block in templates. PR #104, fixes #81.
  • Add a missing } in doc example. PR #102.
  • Update optional rsass to 0.22.0.
  • Updated gotham example to 0.6.0.

Thanks @bearfrieze for #102 and @Aunmag for #81.

Tested with rustc 1.53.0, 1.48.0, 1.46.0, 1.44.1, 1.54.0-beta.1 and 1.55.0-nightly (7c3872e6b 2021-06-24).

v0.13.2 - Mar 14, 2021

  • Improve formatting of README, PR #100.
  • Update nom to 6.1.0, which raises the MSRV to 0.44
  • Update base64 to 0.13 and itertools to 0.10.
  • Update optional rsass to 0.19.0.
  • Add warp 0.3 feature and example.
  • Add tide 0.16 feaure and update example.
  • Testing is now done with github actions rather than Travis CI.
  • Minor clippy fixes, PR #99.

Thanks to @ibraheemdev for PR #100.

Tested with rustc 1.50.0 (cb75ad5db 2021-02-10), 1.48.0 (7eac88abb 2020-11-16), 1.46.0 (04488afe3 2020-08-24), 1.44.1 (c7087fe00 2020-06-17), 1.51.0-beta.6 (6a1835ad7 2021-03-12), 1.52.0-nightly (acca81892 2021-03-13)

v0.13.0 - Nov 15, 2020

  • Try to improve incremental compile times of projects using ructe by only writing fils if their contents actually changed. Also some code cleanup. PR #97.
  • Update ructe itself to use edition 2018 (it is still useable for projects using both editios). PR #98.
  • Fix StaticFiles::add_files_as for empty to argument and add some more documentation for it. Fixes issue #96.
  • Update optional rsass dependency to 0.16.0.
  • Add optional support for tide 0.14 and 0.15.
  • Update gotham to 0.5 and axtix-web to 3.2 in examples.

Tested with rustc 1.47.0 (18bf6b4f0 2020-10-07), 1.42.0 (b8cedc004 2020-03-09), 1.40.0 (73528e339 2019-12-16), 1.48.0-beta.8 (121901459 2020-11-08), and 1.50.0-nightly (98d66340d 2020-11-14)

v0.12.0 - Aug 14, 2020

  • Issue #79, PR #80 and #94: Support Tide framework by a feature and an example.
  • PR #91: Update basic examples to edition 2018.
  • Issue #68, PR #90: Don't eat whitespace after a for loop.
  • Issue #66, PR #89: Fix parse error for nested braces in expressions.
  • PR #84: Use std::ascii::escape_default.
  • PR #87: Provide ToHtml::to_buffer()
  • Forbid unsafe and undocumented code.
  • The build is on https://travis-ci.com/kaj/ructe now.
  • Internal cleanup.

Thanks to @Aunmag and @prabirshrestha for reported issues and contributed code.

Tested with rustc 1.45.2 (d3fb005a3 2020-07-31), 1.42.0 (b8cedc004 2020-03-09), 1.42.0 (b8cedc004 2020-03-09), 1.46.0-beta.4 (32c481e15 2020-08-09), and 1.47.0-nightly (81dc88f88 2020-08-13).

v0.11.4 - Apr 25, 2020

  • Improve @match parsing.

v0.11.2 - Apr 22, 2020

  • Bugfix: Allow whitespace before last brace in @match statements.

v0.10.0 - Apr 19, 2020

  • Update rsass to 0.13.0 and improve sass error handling.
  • Drop the warp01 feature.
  • PR #72 from @kornelski: Avoid clobbering variable name.
  • Update itertools to 0.9.0 and base64 to 0.12.0.

Thanks to @kornelski for suggestions and bug reports.

Tested with rustc 1.42.0 (b8cedc004 2020-03-09), 1.36.0 (a53f9df32 2019-07-03), 1.34.2 (6c2484dc3 2019-05-13), 1.43.0-beta.6 (062dea094 2020-04-18), and 1.44.0-nightly (52fa23add 2020-04-18).

v0.9.2 - Jan 25, 2020

  • PR #70, Issue #63: Add feature warp02, supportig warp 0.2.x, and add a name alias warp01 for the old warp 0.1.x feature. Same in examples.
  • PR #69, Issue #67: Anyting that is allowed in a string in Rust should be allowed in a string in ructe.
  • Fix clippy complaints re statics in generated code.
  • Update actix-web example to 2.0.
  • Fix doctest with mime03 feature.

Thanks to @nocduro and @Aunmag for suggestions and bug reports.

v0.9.0 - Dec 25, 2019

  • PR #65, Issue #64: An expression starting with paren ends on close.
  • RucteError now implements std::error::Error.
  • Specify which references in examples are dyn or impl.
  • Remove a useless string clone.
  • Update rsass to 0.12.0.

Thanks to @Aunmag.

Tested with rustc 1.40.0 (73528e339 2019-12-16), 1.36.0 (a53f9df32 2019-07-03), 1.34.2 (6c2484dc3 2019-05-13), 1.41.0-beta.1 (eb3f7c2d3 2019-12-17), and 1.42.0-nightly (a9c1c04e9 2019-12-24).

v0.8.0 - Nov 06, 2019

  • Issue #62: New version number due to a semver-breaking change, reported by @kornelski.

Otherwise same as 0.7.4:

  • PR #55 from kornelski: Improve benchmarks.
  • Part of issue #20: Allow template source files to be named *.rs.svg or *.rs.xml as well as *.rs.html. The generated template functions will simlilarly be suffixed _svg, _xml or _html (any template_html will get a template alias, for backwards compatibility.
  • PR #61 from Eroc33: Improve parsing for tuple and generic type expressions.
  • Fix old doc link in readme.
  • Update dependencies in ructe and examples.

Thaks to @kornelski and @Eroc33.

v0.7.4 - Nov 02, 2019

Note: This release has been yanked from https://crates.io/ due to a semver-breaking change for 0.7.x. The same code has been re-released as version 0.8.0.

  • PR #55 from kornelski: Improve benchmarks.
  • Part of issue #20: Allow template source files to be named *.rs.svg or *.rs.xml as well as *.rs.html. The generated template functions will simlilarly be suffixed _svg, _xml or _html (any template_html will get a template alias, for backwards compatibility.
  • PR #61 from Eroc33: Improve parsing for tuple and generic type expressions.
  • Fix old doc link in readme.
  • Update dependencies in ructe and examples.

Thaks to @kornelski and @Eroc33.

Tested with rustc 1.38.0 (625451e37 2019-09-23), 1.36.0 (a53f9df32 2019-07-03), 1.34.2 (6c2484dc3 2019-05-13), 1.39.0-beta.8 (f6404c5a9 2019-10-30), and rustc 1.40.0-nightly (87cbf0a54 2019-11-01).

v0.7.2 - Aug 28, 2019

  • Issue #53, PR #60: Allow empty strings everywhere quoted strings are allowed.
  • Issue #57, PR #59:Accept explicit impl and dyn in types.
  • Relax over-strict whitespace requirements, fix a regression in 0.7.0.
  • PR #56: Require buf reference to implement Write, not buf itself
  • PR #58: Fix warnings in generated code.
  • Remove no-longer-used imports.

Thanks to @kornelski for multiple contributions.

Tested with rustc 1.37.0 (eae3437df 2019-08-13), 1.34.2 (6c2484dc3 2019-05-13), 1.32.0 (9fda7c223 2019-01-16), 1.31.1 (b6c32da9b 2018-12-18), 1.38.0-beta.3 (72bfc3753 2019-08-27), 1.39.0-nightly (53df91a9b 2019-08-27).

v0.7.0 - Jul 18, 2019

  • Upgrade nom to 5.0 (#52)
  • Update rsass to 0.11.0 (which also uses nom 5.0)
  • Improve template declaration parsing and diagnostics.
  • PR #50 and #51 from @dkotrada: Fix typos in actix example.
  • Remove deprecated functions.

Thanks to @dkotrada for your contribution!

Tested with rustc 1.36.0 (a53f9df32 2019-07-03), rustc 1.34.2 (6c2484dc3 2019-05-13), rustc 1.32.0 (9fda7c223 2019-01-16), rustc 1.31.1 (b6c32da9b 2018-12-18), rustc 1.37.0-beta.3 (2ba6de7e2 2019-07-12), and rustc 1.38.0-nightly (bc2e84ca0 2019-07-17).

v0.6.4 - Jun 23, 2019

  • Added more modern rust compiler versions (and dropped 1.26).
  • PR #49: Add an actix example.
  • PR #48 from @Noughmad: Use impl Write or generic argument instead of dynamic traits. Fixes a warning for each template when using edition 2018 in nightly rust.
  • Clearer doc about escaping special characters.
  • PR #46 from @kornelski: Add missing crates keyword

Thanks to @kornelski and @Noughmad for your contributions!

Tested with rustc 1.35.0 (3c235d560 2019-05-20), 1.34.2 (6c2484dc3 2019-05-13), 1.32.0 (9fda7c223 2019-01-16), 1.31.1 (b6c32da9b 2018-12-18), 1.29.0 (aa3ca1994 2018-09-11), 1.28.0 (9634041f0 2018-07-30), 1.27.2 (58cc626de 2018-07-18), 1.36.0-beta.5 (07a9daea9 2019-06-07), 1.37.0-nightly (de02101e6 2019-06-22).

v0.6.2 - Mar 16, 2019

  • Improved documentation and examples. All public items now have documentation.

  • Improve build-time error handling. If there is an error involving an environment variable, include the variable name in the message.

  • Take more Path build-time arguements AsRef. Make it possible to simpl use a string literal as a path in more places.

Tested with rustc 1.33.0 (2aa4c46cf 2019-02-28), 1.31.1 (b6c32da9b 2018-12-18), 1.30.1 (1433507eb 2018-11-07), 1.29.0 (aa3ca1994 2018-09-11), 1.28.0 (9634041f0 2018-07-30), 1.27.2 (58cc626de 2018-07-18), 1.26.2 (594fb253c 2018-06-01), 1.34.0-beta.1 (744b374ab 2019-02-26), and 1.35.0-nightly (52e885628 2019-03-15).

v0.6.0 - Mar 14, 2019

  • Provide a warp feature.

    All my warp + ructe projects use the same RenderRucte extension trait to make calling the templates on generating responses a bit clearer. Provide that trait here as an optional feature.

  • Make the build scripts nicer.

    Provide a struct Ructe with methods to handle the red tape from build scripts. Make the remaining parts of the build scripts shorter and more to the point.

  • Use edition 2018 in warp example.

  • Fix examples lang attribute.

    A whole bunch of examples had the html lang attibute set to sv when the content is actually in English.

Tested with 1.33.0 (2aa4c46cf 2019-02-28), 1.31.1 (b6c32da9b 2018-12-18), 1.30.1 (1433507eb 2018-11-07), 1.29.0 (aa3ca1994 2018-09-11), 1.28.0 (9634041f0 2018-07-30), 1.27.2 (58cc626de 2018-07-18), 1.26.2 (594fb253c 2018-06-01), 1.34.0-beta.1 (744b374ab 2019-02-26), and 1.35.0-nightly (719b0d984 2019-03-13).

v0.5.10 - Feb 22, 2019

  • Convert more file names to rust names (a file name might contain dashes and dots that needs to be converted to something else (underscore) to work in a rust name).
  • Find new files in static dirs (add a cargo:rerun-if-changed line for the directory itself).

Tested with rustc 1.32.0 (9fda7c223 2019-01-16), 1.31.1 (b6c32da9b 2018-12-18), 1.30.1 (1433507eb 2018-11-07), 1.29.0 (aa3ca1994 2018-09-11), 1.28.0 (9634041f0 2018-07-30), 1.27.2 (58cc626de 2018-07-18), 1.26.2 (594fb253c 2018-06-01), 1.33.0-beta.9 (1f84156d2 2019-02-20), 1.34.0-nightly (633d75ac1 2019-02-21).

v0.5.8 - Feb 16, 2019

  • Adapt to rsass 0.9.8 (the sass feature now requires a compiler that supports edition 2018).
  • More compact static data, using byte strings instead of numbers. (i.e. b"\xef\xbb\xbfabc" rather than [239, 187, 191, 65, 66, 67]).
  • Minor internal cleanup.
  • Update bytecount dependency.

v0.5.6 - Jan 04, 2019

  • PR #41: Benchmark and improve performance of html-escaping.
  • PR #39: Silence a clippy warning about old syntax in silencing another warning.
  • Update itertools to 0.8 (and env_logger in warp example)

Thanks to @kornelski for PRs #39 and #41.

Tested with rustc 1.31.1 (b6c32da9b 2018-12-18), 1.29.0 (aa3ca1994 2018-09-11), 1.28.0 (9634041f0 2018-07-30), 1.27.2 (58cc626de 2018-07-18), 1.26.2 (594fb253c 2018-06-01), 1.32.0-beta.11 (e64fee6a3 2019-01-04), and 1.33.0-nightly (c0bbc3927 2019-01-03).

v0.5.4 - Nov 30, 2018

  • Support struct unpacking in @if and @for expressions.

Tested with rustc 1.30.1 (1433507eb 2018-11-07), 1.29.0 (aa3ca1994 2018-09-11), 1.28.0 (9634041f0 2018-07-30), 1.27.2 (58cc626de 2018-07-18), 1.26.2 (594fb253c 2018-06-01), 1.31.0-beta.19 (42053f9f0 2018-11-26), and 1.32.0-nightly (3e90a12a8 2018-11-29).

v0.5.2 - Nov 04, 2018

  • Special case for empty sub-templates, mainly to avoid a warning when compiling generated code.
  • Update md5 to 0.6.
  • Update gotham in example to 0.3.0.
  • Use mime 0.3 in static example, and remove mime03 example.

Tested with rustc 1.30.0 (da5f414c2 2018-10-24), 1.29.0 (aa3ca1994 2018-09-11), 1.28.0 (9634041f0 2018-07-30), 1.27.2 (58cc626de 2018-07-18), 1.26.2 (594fb253c 2018-06-01), 1.31.0-beta.4 (04da282bb 2018-11-01), and 1.32.0-nightly (04fdb44f5 2018-11-03).

v0.5.0 - Nov 03, 2018

  • Support multiple Content arguments. Impl Trait is used to make sub-templates as arguments less magic. This way we can also support more than one Content argument to the same template.
  • PR #36 / Issue #35: Test and fix support for edition=2018. Module paths used by generated code are now compatible with the 2018 edition. Also, some code in examples and documentation use more 2018-friendly module paths.
  • PR 34: Use bytecount rather than simple counting, elide one lifetime.
  • Update nom to 4.1.1, base64 to 0.10.0, bytecount to 0.4, and md5 to 0.5.
  • Update iron to 0.6 and warp to 0.1.9 in examples.
  • Minor cleanup in nickel example.

Thanks to @KlossPeter for PR #34 and @matthewpflueger for issue #35.

Tested with rustc 1.30.0 (da5f414c2 2018-10-24), 1.28.0 (9634041f0 2018-07-30), 1.27.2 (58cc626de 2018-07-18), 1.26.2 (594fb253c 2018-06-01), 1.31.0-beta.4 (04da282bb 2018-11-01), and 1.32.0-nightly (8b096314a 2018-11-02).

v0.4.4 - Sep 06, 2018

  • Test and fix #33, unduplicate curly brackets.
  • Add @@ escape, producing a single @ sign. Suggested in #33.
  • Some more mime types for static files.
  • Update dependencies: nom 4.0, rsass 0.9.0
  • Add a warp example, and link to kaj/warp-diesel-ructe-sample

Thanks to @dermetfan for reporting issue #33.

Tested with rustc 1.28.0 (9634041f0 2018-07-30), 1.27.2 (58cc626de 2018-07-18), 1.26.2 (594fb253c 2018-06-01), 1.25.0 (84203cac6 2018-03-25), 1.24.1 (d3ae9a9e0 2018-02-27), 1.23.0 (766bd11c8 2018-01-01), 1.29.0-beta.12 (4dcf42f98 2018-09-04), 1.30.0-nightly (6e0f1cc15 2018-09-05).

v0.4.2 - Aug 01, 2018

  • Test and fix issue #31, comments in body.

Thanks to @jo-so for reporting the issue, and for the test.

Tested with rustc 1.23.0 (766bd11c8 2018-01-01), 1.24.1 (d3ae9a9e0 2018-02-27), 1.25.0 (84203cac6 2018-03-25), 1.26.2 (594fb253c 2018-06-01), 1.27.2 (58cc626de 2018-07-18), 1.29.0-beta.1 (a3bef3daf 2018-07-31), 1.29.0-nightly (e94df4acb 2018-07-31).

v0.4.0 - Jul 05, 2018

Changes since v0.3.16 includes:

  • Template syntax:

    • Allow local ranges (i.e. 2..7) in loop expressions.
    • Allow underscore rust names. There is use for unused variables in templates, so allow names starting with underscore.
    • Issue #24 / PR #28: Allow logic operators in @if ... expressions.
    • Issue #25 / PR #27: Allow much more in parentehsis expressions.
  • Improved examples:

    • A new design for the framework examples web page, using svg graphics.
    • Improve code and inline documentation of iron and nickel examples.
    • Add a similar example with the Gotham framework.
  • Recognize .svg static files.

  • Allocate much fewer strings when parsing expressions in templates.

  • PR #26: use write_all rather than the write! macro in generated code, contributed by @kornelski

  • Fix application/octet-stream MIME type. Contributed by @kornelski.

  • Use write_str/write_all when generating output. Contributed by @kornelski.

Tested with rustc 1.23.0 (766bd11c8 2018-01-01), 1.24.1 (d3ae9a9e0 2018-02-27), 1.25.0 (84203cac6 2018-03-25), 1.26.2 (594fb253c 2018-06-01), 1.27.0 (3eda71b00 2018-06-19), 1.28.0-beta.6 (915ac6602 2018-06-30), and 1.28.0-nightly (e3bf634e0 2018-06-28).

v0.3.16 - Apr 08, 2018

Changes since 0.3.14 is mainly some internal cleanup, a link fix in README and the option rsass dependency is updated to 0.8.0.

Tested with rustc 1.23.0 (766bd11c8 2018-01-01), 1.24.1 (d3ae9a9e0 2018-02-27), 1.25.0 (84203cac6 2018-03-25), 1.26.0-beta.2 (0e350672e 2018-04-05), and 1.27.0-nightly (eeea94c11 2018-04-06).

v0.3.14 - Mar 11, 2018

Changes since v0.3.12 includes:

  • Make the space after a comma in list expressions optional.
  • Allow enum variants (and module names) in expressions.
  • Some cleanup in parser code.

Tested with rustc version 1.18.0 (03fc9d622 2017-06-06), 1.19.0 (0ade33941 2017-07-17), 1.20.0 (f3d6973f4 2017-08-27), 1.21.0 (3b72af97e 2017-10-09), 1.22.1 (05e2e1c41 2017-11-22), 1.23.0 (766bd11c8 2018-01-01), 1.24.1 (d3ae9a9e0 2018-02-27), 1.25.0-beta.9 (16262bb5e 2018-03-09), 1.26.0-nightly (2789b067d 2018-03-06).

v0.3.12 - Feb 10, 2018

Changes since 0.3.10 includes:

  • Add a way to add static files without hashnames. A static file can be added and mapped as an arbitrary name, or a directory can be recursively added with an arbitrary prefix.

Tested with rustc 1.18.0 (03fc9d622 2017-06-06), 1.19.0 (0ade33941 2017-07-17), 1.20.0 (f3d6973f4 2017-08-27), 1.21.0 (3b72af97e 2017-10-09), 1.22.1 (05e2e1c41 2017-11-22), 1.23.0 (766bd11c8 2018-01-01), 1.24.0-beta.11 (03f456d3c 2018-02-03), and 1.25.0-nightly (3bcda48a3 2018-02-09).

v0.3.10 - Dec 30, 2017

Changes since version 0.3.8 includes:

  • Allow * at start of expressions (and subexpressions).
  • Updated (optional) rsass to ^0.7.0.
  • Updated base64 to ^0.9.0.

Tested with rustc 1.18.0 (03fc9d622 2017-06-06), 1.19.0 (0ade33941 2017-07-17), 1.20.0 (f3d6973f4 2017-08-27), 1.21.0 (3b72af97e 2017-10-09), 1.22.1 (05e2e1c41 2017-11-22), 1.23.0-beta.2 (c9107ee93 2017-12-08), 1.24.0-nightly (2dad872a2 2017-12-29).

Information - Updated May 09, 2022

Stars: 268
Forks: 26
Issues: 17

Repositories & Extras

Yet Another Rust Template Engine

bytes-buf feature can produce SIGILL

Yet Another Rust Template Engine

Advent of Code Rust Template

Advent of Code Rust template from

Advent of Code Rust Template

rust-parcel-template

Kickstart your Rust, WebAssembly, and Parcel project!

rust-parcel-template

Rust CLI template

A quick and dirty CLI boilerplate template for Rust

Rust CLI template

SixtyFPS Rust Template

A template for a Rust application that's using SixtyFPS for the user interface

SixtyFPS Rust Template

Embedded Rust Template

This template is based on stm32f4xx-hal

Embedded Rust Template

serverless AWS Rust template

A sample template for bootstrapping serverless framework cli

serverless AWS Rust template

serverless AWS Rust template

A sample template for bootstrapping serverless framework cli

serverless AWS Rust template

Template: Rust + OpenGL + SDL2

This template should get you started using OpenGL in Rust

Template: Rust + OpenGL + SDL2

OpenFaas Rust Template

A Rust template for OpenFaas using the of-watchdog

OpenFaas Rust Template

AoC Rust Template

This repository is used as a template for cargo-generate as follows:

AoC Rust Template
Facebook Instagram Twitter GitHub Dribbble
Privacy