#e453061 wysłany 05-09-2009 o 21:29:08
Another preview version of SithTemplate 1.1 is available on bitbucket.
To get unprocessed source, use bitbucket's snapshots (above link), or use:
hg clone https://bitbucket.org/piotrlegnica/sithtemplate/
cd sithtemplate
hg up release-1.1a2
Main 1.1a2 features are few Django-compatibility fixes, and (finally) finished (and comments are more than welcome) tutorial and the standard library reference - with examples! "Extending" part is still in TODO, though.
The most important changes:
- Documentation! Examples!
{% block N append %} has been replaced by Django-compatible (and far more flexible) {{ block.super }} special variable
TemplateEnviron::getMeta now strips the user: prefix
- Added "openbrace" and "closebrace" to
{% templatetag %}
- Fixed incorrect
pluralize filter behaviour
- Using
{% extends %} more than once in a template is now explicitly forbidden, and raises an E_INVALID_SYNTAX
Full Mercurial-generated changelog:
#e451415 wysłany 13-08-2009 o 16:45:23
New preview version of SithTemplate 1.1 is available on BitBucket.
Documentation is still not complete, but I'll be gone for a week or so, and won't be able to finish it. Releasing it mainly because of the broken 5.1 support in 1.1a0.
Main changes in this release are:
- fixed PHP 5.1 compatibility, and more unittests (ran on 5.1, 5.2 and 5.3)
- addition of custom metadata, set by
{% meta key "value" %} tag, and retrieved by TemplateEnviron::getMeta call
- added
TemplateEnviron::render shortcut call
- new security settings to restrict
{{ internal }} - allowInternalConstants and allowInternalRequest
- I/O restricting and
restrictExtendIO and restrictIncludeIO settings
- Fixed
{% extends %} not being able to use different I/O driver
Full Mercurial-generated changelog:
#e416716 wysłany 22-09-2008 o 23:46:16
In 0.9 and earlier, both libraries and I/O drivers were called "plugins". As of 0.10, plugin is a bundle, containing any number of elements.
- Plugins need explicit loading on application side (either by new config var
autoloadPlugins, or by TemplateCore::loadPlugin API).
- Libraries can still be loaded from within templates (just for this template), and additionally from application (using either config var
autoloadLibraries or TemplateCore::loadLibrary API; for all templates).
- Libraries have to be referenced to as
Plugin.Library.
- Difference between runtime and compile time libraries is gone.
- Hooks are no longer contained in libraries.
- New extension types will be available - I/O filters and cache drivers.
- The only remaining interfaces are those related to plugins (e.g.
ITemplatePlugin, ITemplateLibrary).
I/O filters will be called in defined order (in filtersInput and filtersOutput config vars) on both template input (unparsed) and template output (not template PHP code, but the result of rendering).
Cache drivers - there will be one instance-wide (cacheDriver config var) driver, that will be passed to I/O drivers.
Example plugin's main class.
Sorry for chaotic Engrish, feel free to contact me if something is unclear, or if you have any suggestions.
#e412558 wysłany 23-08-2008 o 18:08:44
Continuing this entry:
- Expression parsing will be postponed at least until 0.11.
- Library loading will be possible at both application- and template-side. Both will also be restricted to
securityLibraries list (unless secure mode is disabled).
- New plugin system, with new metadata system to declare tags, filters, hooks, I/O drivers, etc. I thought about using strict naming convention, but that wouldn't work well for e.g. hooks, where one hookpoint can have many handlers in many libraries attached. I'll post more info later.
- And maybe, with new plugin system - tag/filter namespaces, either implicit (library name) or explicit.
As always - feedback is welcome.
#e410423 wysłany 13-08-2008 o 00:33:36
Even though 0.10 has no specific release date yet (trunk after nearly 100 revisions is still broken and unusable, and most of the code needs at least refactoring), here are the most important changes (in random order):
- Hard-coded variable prefix (to [surprise]
$).
- Unicode awareness, and, (un)fortunately, mbstring dependency.
- Expression parsing, without filtering support (parser is huge, ugly and hard to understand even without them. Better ideas, anyone? ^^). With this, you'll be able to do things like
{% include $page~".html" %}.
- Library loading moved to application code. So there will be something like
$tpl->loadLibrary('CoreI18n'); instead of {% load CoreI18n %}.
- New exception model. Both
TemplateRuntimeError and TemplateSyntaxError are now combined into single TemplateError (with string-based IDs, and isXxxError methods).
- Main class moved to
TemplateCore.
Yes, that means API and template syntax changes. Sorry about that. Any of these changes can be reverted/not implemented, so all suggestions are welcome.
Sourceforge / Ohloh.