Releases: roadelou/template
Template Parallel Processing
This new release introduces parallel processing to the template
tools!
Different files and different shell commands are now handled in parallel using a pthread-based threadpool mechanism. This enable a much faster processing of larger workloads.
Template shared library
This new release fixes some bugs from the old version and greatly improves the distributed packages 🎉
The new packages include:
- Two man pages
man 1 template
andman 1 template-run
which contain some documentation on the two executables. - The libtemplate.so shared library used by the two executable and available for other applications.
- The (commented) header files needed to develop with the template library.
The packaging work has also been done for debian-based system, with the prepared deb-file available from the GitHub release page of the template project, along the usual rpm-file for fedora-based distributions.
template-run tool
This release adds a new template-run
tool which is used to execute a template file directly from the command line. The documentation has been updated to include some elements about the new tool.
Tests have also been added to the codebase, and a number of bugs related to out-of-bounds memory accesses in the extension
part of the library have been fixed.
Automatic Shell Newline Handling
With this new release, the trailing newlines from the shell subcommands are automatically ignored, which makes the template files much simpler and much more readable. The --author
and --contact
options are also correctly handled with the new --dynamic
formatting style.
Dynamic Formatting
This new release introduces a first version of dynamic formatting, which changes the syntax for template files. The older static syntax can still be used thank to the -s
o --static
flag.
The dynamic formatting relies on format specifiers similar to %/ [...] /
, where /
can be any ASCII character and [...]
is some shell command whose whose output should be used to replace the specifier in the output file. Note that most shell commands output a trailing newline, hence a | tr -d '\n'
is often needed to produce the desired file. The replaceable /
delimiter is similar to the way the sed
command works.
An example template file could be:
Hello %/echo $TEMPLATE_USER | tr -d '\n'/, today is the %/date +%F | tr -d '\n'/!
The corresponding output file could then be:
Hello roadelou, today is the 2021-11-07!
List Rebase
This new release is an internal rework of the codebase. No new features have been added, but the new codebase will enable adding interesting new features in the future 👍
One of the most interesting changes is the new List
type which is used to hold a resizable vector of strings.
Matching Switch
This release introduces two new CLI options: -0, --old
will make template use the weaker but simpler extension matching algorithm, while -n, --new
will use the more powerfull hierarchical extension matching algorithm.
Logging and Verbosity
This release add some logging abilities to template. It will now print INFO, WARNING and ERROR messages to the user. The -v
and -q
command line flags can be used to tune the verbosity of the outputted information.
Improved Extension Search
This release removes most of the bugs that had made it through the previous release. I also improved the testing workflow 👍
The RPM package for fedora 33 is also directly downloadable from GitHub.
Hierarchical Extension Search
This new release adds support for hierarchical extension search, as described in the documentation.
This is particularly useful for license headers, since it allows one to create templates with larger extensions that will be picked instead of the more generic ones.