Skip to content

Releases: kblomqvist/yasha

5.0

31 Jan 21:19
Compare
Choose a tag to compare
  • Dropped support for Python 2.7. From this version onward Python 3.6 or newer is required (preparing for the upcoming major release of Jinja2).
  • Fixed compatibility issue with Jinja 2.11.x (gh-60). From this version onward Yasha requires Jinja 2.11 or newer.
  • Removed option --keep-trailing-newline in favor of keeping the trailing newline by default. The old behavior can be achieved with a new option --remove-trailing-newline.

4.4

23 Aug 08:05
Compare
Choose a tag to compare
4.4
  • Fixed an exit code in case of undefined variable from 0 to 1.
  • Fixed a bug that caused extension classes not to load.
  • Quoted string variable with commas is not converted to list anymore (gh-57).
  • Implemented workaround for Jinja 2.11 compatibility issue (gh-60)
  • Added support for INI and CSV file parsing.
  • Fixed a bug that caused Yasha to crash when loading file extensions
    (regression likely caused by Click).

NOTE! Last release with Python 2.7 support

4.3

01 May 12:26
Compare
Choose a tag to compare
4.3
  • Added new option --mode [pedantic|debug]. In pedantic mode Yasha becomes extremely picky on templates, e.g. undefined variables will raise an error. In debug mode undefined variables will print as is.
  • Jinja's default configurations can be set in file extensions. This allows changing the template syntax to mimic LaTeX, for example.

4.2

18 Mar 11:54
Compare
Choose a tag to compare
4.2
  • Added support for multiple variables files.

4.1

29 Oct 18:17
Compare
Choose a tag to compare
4.1
  • Fixed a bug related to automatic variable file lookup. Variable file like templates, e.g. templates with .json extension, were erronously used as a variable file too.

4.0

08 Oct 17:24
Compare
Choose a tag to compare
4.0
  • Reverted the change introduced in version 3.0 to use uppercase -E and -V option flags for extension and variable files. Fixes the SCons builder, which was still using lowercase options.
  • Changed the way how template variables given as part of the command-line call are defined. From this version all unknown long options which has a proper value are interpreted as a template variable, e.g. --foo=bar or --foo bar. Note that -v foo bar is not working anymore.
  • Fixed an issue where the command-line call yasha ../template.j2 searched for template companion files till root folder.
  • Python literals can be used as part of the command-line call, e.g. yasha --foo "['bar', 'baz']" template.j2.
  • Added env template filter to read system environment variable.
  • Added shell template filter to run a shell command. and to connect its standard output. Requires Python >= 3.5.
  • Added subprocess template filter to spawn new processes, but unlike shell a CompletedProcess instance is returned, or CalledProcessError in case of error. Requires Python >= 3.5.
  • Added parser for XML type of variable files. Uses xmltodict.
  • Added command-line option -c to set template encoding. Default is UTF-8.
  • JSON parser updated to use safe_load (security).
  • Within extension file, custom variable file parsers are now defined either as a function named as parse_+ <file extension>, or the parse-function is given via PARSERS dictionary with the key indicating the file extension.
  • Within extension file, custom filters and tests can be also given via FILTERS and TESTS dictionary. This allows using external filters easily, e.g. from Ansible.
  • Common extension file can be now set via YASHA_EXTENSIONS system environment variable.
  • Command-line option --no-variables changed to --no-variable-file.
  • Command-line option --no-extensions changed to --no-extension-file.
  • Removed the variable/extension file overwrite protection introduced in version 3.1. Caused more confusion than protection.

3.1

16 Jul 09:03
Compare
Choose a tag to compare
3.1
  • Support JSON formatted variable files.
  • Prevent misoverwrition of the variable/extension file by the rendered template.

3.0

02 Jul 14:55
Compare
Choose a tag to compare
3.0
  • Added support for inline variables via -v option. This change broke backward compatibility as variable and extension files are now given via -V and -E, respectively.
  • Added --keep-trailing-newline option.

2.1

30 Oct 18:28
Compare
Choose a tag to compare
2.1
  • Start using a template stream instead of render function. Should improve the rendering speed of large templates.
  • Fix yasha to work with standard input/output -- was got broken. Added unit test to ensure that it won't happen again.
  • Yasha won't try to "fix" file termination of the rendered template anymore, i.e. stripping the file and making it newline terminated.

2.0

13 Mar 10:54
Compare
Choose a tag to compare
2.0
  • Added a new command-line option -I (or --searchpath) to add DIRECTORY to the list of directories to be searched for referenced templates, aka hard-coded template extensions, inclusions and imports, in TEMPLATE.
  • Referenced templates are now included in Makefile compatible list of dependencies (option -M / -MD).
  • Fixed SCons CBuilder to take referenced template and custom parser dependencies into account.
  • Enabled Jinja whitespace control, trim_blocks=True and lstrip_blocks=True. This change has an effect on how the template is rendered.
  • Added command line options --no-trim-blocks and --no-lstrip-blocks to allow disabling the whitespace control.
  • Removed command-line option --trim in favor of Jinja's whitespace control.
  • Added command-line option --version to print version.
  • Added check to make sure that the rendered template has a signle newline at the end of file.