13 releases

✓ Uses Rust 2018 edition

0.2.0 Mar 31, 2019
0.1.1 Mar 13, 2019
0.0.10 Mar 11, 2019
0.0.5 Feb 28, 2019

#47 in Template engine

Download history 5/week @ 2019-02-12 34/week @ 2019-02-19 51/week @ 2019-02-26 56/week @ 2019-03-05 62/week @ 2019-03-12 27/week @ 2019-03-19 222/week @ 2019-03-26 98/week @ 2019-04-02 78/week @ 2019-04-09 58/week @ 2019-04-16 65/week @ 2019-04-23 82/week @ 2019-04-30

160 downloads per month
Used in 2 crates


170 lines


yarte_config is the crate in charge of parsing the configure file, yarte.toml, to a rust object that will later be treated in the rest of the crates. Right now a Yarte configuration file can have the following:

  • main (general configuration - optional): with attribute

    • dir: name of template directory. If no value is given, a default directory templates will be used. If the defined directory is not found, an error will prompt.
    • debug: type of output of debug mode. The code and/or ast generated by Yarte can be visualize, to do so, at most one of three possible values has to be given: code, ast, or all.
  • partials (partials aliasing - optional): each entry must be of the type name_alias = "./alias/path/", where ./ makes reference to dir value. Path must exist, or error will be prompt. If the tag partials doesn't exist no aliasing will be possible.

  • debug (debugging configuration - optional): in order to visualize clearly generated code in a debugging environment Yarte gives it a tabulated format, and the possibility to see the number line use a color theme. Options are the following:

    • number_line (default: false): Boolean, if set to true number lines will appear in debug-mode.
    • theme (default: zenburn): String, color theme used in debugging environment. Possible values are:
      • DarkNeon,
      • GitHub,
      • Monokai Extended,
      • Monokai Extended Bright,
      • Monokai Extended Light,
      • Monokai Extended Origin,
      • OneHalfDark,
      • OneHalfLight,
      • Sublime Snazzy,
      • TwoDark,
      • zenburn

In future versions, more features will be added to the configuration file.

Example of a config file

dir = "templates"
debug = "all"

alias = "./deep/more/deep"

theme = "zenburn"
number_line = true
grid = true
header = true
paging = false
short = false

With this configuration, the user can call alias in a partial instance with {{> alias context}} or {{> alias}} if the current context is well defined.


~30K SLoC