Releases: dymk/temple
Vibe.d Compatibility Fix
Vibe 0.7.24 Compatibility
v0.7.4 Merge branch 'Yoplitein-vibe724fix' into develop
v0.7.3: Merge pull request #24 from gedaiu/master
Version bump for better testing behavior
Fixed Vibe.d Integration
Vibe.d integration has been fixed up, thanks to @legobear154
v0.7.1: Merge pull request #18 from dymk/develop
update temple config
Temple gets a new (much nicer) API!
Temple 0.7.0 brings a new API that makes working with templates much easier. Internally, the library no longer has to allocate nearly as much, and users can now pass any arbitrary output range/sink function to render into.
The biggest change will be that Temple no longer returns a function representing the compiled template, but rather a CompiledTemple
object for interacting with the template. This change opens up the ability to create arbitrary layout-partial nestlings, and pass around templates within templates themselves.
The API is also much easier to use, and no longer requires the use of functions like templeToString
or AppenderOuputStream
. Take a look at the documentation for more information.
Changes in bullet point form (copied from the PR):
- Renamed Temple and TempleFile to
compile_temple
andcompile_temple_file
- Got rid of TempleLayout and TempleLayoutFile; they're covered by CompileTemplate#layout now
- Templates are now represented as structs with methods on them rather than a function that must be
alias
'd - Because of this, Temple templates can now be passed around as first-class objects
- Template layout/child structures can be arbitrarily complex (a layout within a layout within a layout, etc).
- Introduced passing any arbitrary sink object/function to CompiledTemplate#render
- Compile Time Compile Time templates are going away for now, until DMD can interpret delegate members.
- Cleaned up the documentation (although it still needs a lot of work)
Some notes on upgrading from Temple 0.6.2:
- Rename
Temple
andTempleFile
tocompile_temple
andcompile_temple_file
- Change
alias my_temple = compile_temple!()
toauto my_temple = compile_temple!()
- Get rid of all
AppenderOuputStream
s. Usemy_temple.toString(optional_ctx)
. - If an arbitrary range is needed, use
my_temple.render(your_output_range, optional_ctx)
.
Breakage should be minimal for an API change this big still, as there's only a deprecation warning for using Temple
over compile_temple
in this release.
Fix for 2.066.1 Compatibility
Brings Temple up to work with DMD version 2.066.1, and fixes a hidden 32 bit bug.
v0.6.1: Filters, Refactoring, and Unicode
New in the 0.6.x line:
FilterPolicies
to hook into Temple and filter evaluated expressions - for instance, to escape generated HTML, or implement safe strings.- Unicode support (all unicode should work in this release!)
- Vibed integration, if the library detects it's being compiled with Vibed.