[Jifty-commit] r4023 - Template-Declare

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Sep 1 00:31:11 EDT 2007


Author: agentz
Date: Sat Sep  1 00:31:11 2007
New Revision: 4023

Modified:
   Template-Declare/README

Log:
TD - updated README accordingly

Modified: Template-Declare/README
==============================================================================
--- Template-Declare/README	(original)
+++ Template-Declare/README	Sat Sep  1 00:31:11 2007
@@ -212,7 +212,59 @@
     roots
     postprocessor
 
-  PITFALLS
+  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
+    "output" method if the output method you've chosen returns content
+    instead of outputting it directly.
+
+    (If called in scalar context, this method will also just return the
+    content when available).
+
+  alias
+     alias Some::Clever::Mixin under '/mixin';
+
+  import_templates
+     import_templates Wifty::UI::something under '/something';
+
+  path_for $template
+     Returns the path for the template name to be used for show, adjusted
+     with paths used in import_templates.
+
+  has_template PACKAGE TEMPLATE_NAME SHOW_PRIVATE
+    Takes a package, template name and a boolean. The boolean determines
+    whether to show private templates.
+
+    Returns a reference to the template's code if found. Otherwise, returns
+    undef.
+
+    This method is an alias for "resolve_template"
+
+  resolve_template TEMPLATE_PATH INCLUDE_PRIVATE_TEMPLATES
+    Turns a template path ("TEMPLATE_PATH") into a "CODEREF". If the boolean
+    "INCLUDE_PRIVATE_TEMPLATES" is true, resolves private template in
+    addition to public ones.
+
+    First it looks through all the valid Template::Declare roots. For each
+    root, it looks to see if the root has a template called $template_name
+    directly (or via an "import" statement). Then it looks to see if there
+    are any "alias"ed paths for the root with prefixes that match the
+    template we're looking for.
+
+  register_template PACKAGE TEMPLATE_NAME CODEREF
+    This method registers a template called "TEMPLATE_NAME" in package
+    "PACKAGE". As you might guess, "CODEREF" defines the template's
+    implementation.
+
+  register_template PACKAGE TEMPLATE_NAME CODEREF
+    This method registers a private template called "TEMPLATE_NAME" in
+    package "PACKAGE". As you might guess, "CODEREF" defines the template's
+    implementation.
+
+    Private templates can't be called directly from user code but only from
+    other templates.
+
+PITFALLS
     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.
@@ -280,61 +332,11 @@
 
            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
-    "output" method if the output method you've chosen returns content
-    instead of outputting it directly.
-
-    (If called in scalar context, this method will also just return the
-    content when available).
-
-  alias
-     alias Some::Clever::Mixin under '/mixin';
-
-  import_templates
-     import_templates Wifty::UI::something under '/something';
-
-  path_for $template
-     Returns the path for the template name to be used for show, adjusted
-     with paths used in import_templates.
-
-  has_template PACKAGE TEMPLATE_NAME SHOW_PRIVATE
-    Takes a package, template name and a boolean. The boolean determines
-    whether to show private templates.
-
-    Returns a reference to the template's code if found. Otherwise, returns
-    undef.
-
-    This method is an alias for "resolve_template"
-
-  resolve_template TEMPLATE_PATH INCLUDE_PRIVATE_TEMPLATES
-    Turns a template path ("TEMPLATE_PATH") into a "CODEREF". If the boolean
-    "INCLUDE_PRIVATE_TEMPLATES" is true, resolves private template in
-    addition to public ones.
-
-    First it looks through all the valid Template::Declare roots. For each
-    root, it looks to see if the root has a template called $template_name
-    directly (or via an "import" statement). Then it looks to see if there
-    are any "alias"ed paths for the root with prefixes that match the
-    template we're looking for.
-
-  register_template PACKAGE TEMPLATE_NAME CODEREF
-    This method registers a template called "TEMPLATE_NAME" in package
-    "PACKAGE". As you might guess, "CODEREF" defines the template's
-    implementation.
-
-  register_template PACKAGE TEMPLATE_NAME CODEREF
-    This method registers a private template called "TEMPLATE_NAME" in
-    package "PACKAGE". As you might guess, "CODEREF" defines the template's
-    implementation.
-
-    Private templates can't be called directly from user code but only from
-    other templates.
-
 BUGS
     Crawling all over, baby. Be very, very careful. This code is so cutting
-    edge, it can only be fashioned from carbon nanotubes.
+    edge, it can only be fashioned from carbon nanotubes. But we're already
+    using this thing in production :) Make sure you have read the PITFALL
+    section above :)
 
     Some specific bugs and design flaws that we'd love to see fixed.
 


More information about the Jifty-commit mailing list