Repository navigation
v0.1.0
Added
LoaderandLookup: find a template by name (an exact file name, or the
file whose stem is the name and whose suffix the highest-priority engine
claims, soboot.cfg.j2beats a leftoverboot.cfg.bak) under several
roots, with
per-callercandidatesandpaths, and render it with the engine its suffix
names.render(name, data, **overrides);namemay be a list of names,
the first one found wins. A name holding.., a backslash or a drive is
refused on every platform.Lookup.clear();LOOKUP_CACHE_SIZE.- Engines: Jinja, mako, Liquid, Handlebars, Mustache (each behind an extra of
that name), ERB (ruby), EPP (puppet), a%{NAME}shell engine and a
byte-exact copy engine for every other file. - Includes in Jinja, mako, Liquid, Handlebars and Mustache resolve through the
lookup that loaded the including file, to the same file and engine a render
of that name would use: a file of another engine is rendered by that engine
with the current data and its output inserted. undefined="strict" | "lenient" | "debug"for every engine that can honour
it.- The engine registry (
register_engine,unregister_engine,
registered_engines, thetplx.enginesentry-point group) and
tplx.testing.EngineContract, the suite every engine passes. DataEncoder, the loader'sencoder=: how data reaches Liquid,
Handlebars, Mustache (view), ERB and EPP (json) and the shell engine
(flatten); a subclass overridesdefault,keyandtext.Loader(configure={EngineClass: function}): Jinja and Liquid environments,
the makoTemplateLookupand the Handlebars helpers, set up once per lookup.- The
tplxcommand (cliextra):tplx render,tplx find,
tplx engines. TplxErrorand its subclasses intplx.exceptions; theTPLX_RUBYand
TPLX_PUPPETenvironment variables.
Full Changelog: https://github.com/jose-pr/tplx/commits/v0.1.0