[Jifty-commit] r3897 - Template-Declare
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Aug 14 02:20:34 EDT 2007
Author: agentz
Date: Tue Aug 14 02:20:34 2007
New Revision: 3897
Modified:
Template-Declare/README
Log:
updated README via perldoc
Modified: Template-Declare/README
==============================================================================
--- Template-Declare/README (original)
+++ Template-Declare/README Tue Aug 14 02:20:34 2007
@@ -156,7 +156,7 @@
# <div id="footer">Page last generated at Mon Jul 2 17:09:34 2007.</div>
# </html>
- For more options (especially the "native" XML namespace support and more
+ For more options, especially the "native" XML namespace support and more
samples, see Template::Declare::Tags.
Postprocessing
@@ -213,13 +213,12 @@
postprocessor
PITFALLS
- We're reusing the perl interpreter to for our templating langauge, but
- Perl was not designed perfectly for our purpose here. Here are some
- known pitfalls while you're scripting your templates with this module.
+ We're reusing the perl interpreter for our templating langauge, but Perl
+ was not designed specifically for our purpose here. Here are some known
+ pitfalls while you're scripting your templates with this module.
* It's quite common to see tag sub calling statements without trailing
- semi-colons right after "}" in code that uses this module. For
- example,
+ semi-colons right after "}". For instance,
template foo => {
p {
@@ -240,22 +239,21 @@
};
But "xml_decl" is a notable exception. Please always put a trailing
- semicolon after "xml_decl { ... }", or the outputs will be messed
- up.
+ semicolon after "xml_decl { ... }", or you'll mess up the outputs.
* Another place that requires trailing semicolon is the statements
- before a Perl looping and branching statements, for example:
+ before a Perl looping or branching statement, for example:
p { "My links:" };
for (@links) {
with( src => $_ ), a {}
}
- the ";" after " p { ... } " is required here, or Perl will croak for
- syntax errors.
+ The ";" after " p { ... } " is required here, or Perl will complaint
+ about syntax errors.
- * Literal strings that are not in the last statement in a code block
- won't be captured. So the following template
+ * Literal strings that have tag siblings won't be captured. So the
+ following template
p { 'hello'; em { 'world' } }
@@ -276,6 +274,11 @@
p { outs 'hello'; em { 'world' } }
+ Note you can always get rid of the "outs" crap if the string literal
+ is the only element of the containing block:
+
+ p { 'hello, world!' }
+
show TEMPLATE_NAME
Call "show" with a "template_name" and "Template::Declare" will render
that template. Content generated by show can be accessed with the
More information about the Jifty-commit
mailing list