From 5dd81af3d30632382e124378bdab886f1393a604 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 5 Apr 2012 09:22:05 -0400 Subject: [PATCH] added some 'why tpac' and syntax content Signed-off-by: Bill Erickson --- eg2012_tpac.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/eg2012_tpac.txt b/eg2012_tpac.txt index 1402cb6c9..143bb9a93 100644 --- a/eg2012_tpac.txt +++ b/eg2012_tpac.txt @@ -27,3 +27,44 @@ Scratch Outline * Wither JSPAC / Whither TPAC (see also hackfest) -- 5 mins * Questions -- 5 mins +Why TPAC? +--------- + + * Speed (initial page loading and rendering) + * Cross-browser consistency + * Flexible template engine (overlays, etc.) improves skinning + * Accessibility + * Dynamic, gettext-based string translations + * Reduced per-feature speed cost + * Simplified error detection. Errors occur on the server. + * Reduced variability of code in the wild (JS caching) + * Reduced bandwidth requirements + * Reduced client resources (RAM/CPU) requirements + * JavaScript/AJAX is still an option when needed (e.g. added content, staff client integration) + +Template Toolkit Syntax +----------------------- + +http://template-toolkit.org + +Template Toolkit Syntax: I18N +----------------------------- + +[source, html] +------------------------------------------------------------------------------ + +
Hello, [% world_string %]!
+------------------------------------------------------------------------------ + +[source, html] +------------------------------------------------------------------------------ + +
[% l('Hello, [_1]!', world_string) %]
+------------------------------------------------------------------------------ + +[source, html] +------------------------------------------------------------------------------ + +[% l("I would like [quant,_1,apple,apples], please.", num_apples); %] +------------------------------------------------------------------------------ + -- 2.11.0