Releases: kblomqvist/yasha
Releases · kblomqvist/yasha
5.0
- 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-newlinein favor of keeping the trailing newline by default. The old behavior can be achieved with a new option--remove-trailing-newline.
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
- 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
- Added support for multiple variables files.
4.1
- Fixed a bug related to automatic variable file lookup. Variable file like templates, e.g. templates with
.jsonextension, were erronously used as a variable file too.
4.0
- Reverted the change introduced in version 3.0 to use uppercase
-Eand-Voption 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=baror--foo bar. Note that-v foo baris not working anymore. - Fixed an issue where the command-line call
yasha ../template.j2searched 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
envtemplate filter to read system environment variable. - Added
shelltemplate filter to run a shell command. and to connect its standard output. Requires Python >= 3.5. - Added
subprocesstemplate 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
-cto 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 viaPARSERSdictionary with the key indicating the file extension. - Within extension file, custom filters and tests can be also given via
FILTERSandTESTSdictionary. This allows using external filters easily, e.g. from Ansible. - Common extension file can be now set via
YASHA_EXTENSIONSsystem environment variable. - Command-line option
--no-variableschanged to--no-variable-file. - Command-line option
--no-extensionschanged to--no-extension-file. - Removed the variable/extension file overwrite protection introduced in version 3.1. Caused more confusion than protection.
3.1
- Support JSON formatted variable files.
- Prevent misoverwrition of the variable/extension file by the rendered template.
3.0
- Added support for inline variables via
-voption. This change broke backward compatibility as variable and extension files are now given via-Vand-E, respectively. - Added
--keep-trailing-newlineoption.
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
- 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=Trueandlstrip_blocks=True. This change has an effect on how the template is rendered. - Added command line options
--no-trim-blocksand--no-lstrip-blocksto allow disabling the whitespace control. - Removed command-line option
--trimin favor of Jinja's whitespace control. - Added command-line option
--versionto print version. - Added check to make sure that the rendered template has a signle newline at the end of file.