11 releases

0.2.0 Nov 30, 2021
0.1.1 Oct 3, 2020
0.1.0 May 4, 2020
0.0.9 Apr 23, 2020
0.0.7-alpha.2 Feb 28, 2020

#396 in Template engine

28 downloads per month
Used in 2 crates

MIT license

89KB
2.5K SLoC

acick-config

crates.io docs


lib.rs:

Config for acick.

Templates

In some fields, you can use Tera template. Tera template is similar to Jinja2 and Django templates. See Tera documentation for details.

Following filters are available in addition to built-in filters of Tera.

  • camel : converts string to camelCase
  • pascal : converts string to PascalCase
  • snake : converts string to snake_case
  • kebab : converts string to kebab-case

Available variables depend on fields. See Field features section for details.

Field features

Fields have following features.

[c] Command template field

The field is recognized as an array of Tera templates with the following variables available:

  • command (str): command to be executed on shell

[t] Target template field

The field is recognized as a Tera template with the following variables available:

  • service (str): id of service (e.g.: atcoder)
  • contest (str): id of contest (e.g.: arc100)
  • problem (str): id of problem (e.g.: C)

[p] Problem template field

The field is recognized as a Tera template with the following variables available:

  • service (object): object that describes service
  • contest (object): object that describes contest
  • problem (object): object that describes problem

[s] Shell-expanded field

The field is processed with shell-like expansions.

  • Tilde ~ is expanded to the home directory.
  • Environment variables are expanded into their values.

When combined with Tera template, the field is first processed as a template and then expanded.

Dependencies

~21–34MB
~543K SLoC