[Jifty-commit] r2525 - in Template-Declare: lib/Template

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Jan 18 00:13:30 EST 2007


Author: jesse
Date: Thu Jan 18 00:13:29 2007
New Revision: 2525

Added:
   Template-Declare/MANIFEST
   Template-Declare/README
Modified:
   Template-Declare/   (props changed)
   Template-Declare/META.yml
   Template-Declare/SIGNATURE
   Template-Declare/lib/Template/Declare.pm

Log:
 r21085 at hualien:  jesse | 2007-01-18 00:12:37 -0500
  * 0.02


Added: Template-Declare/MANIFEST
==============================================================================
--- (empty file)
+++ Template-Declare/MANIFEST	Thu Jan 18 00:13:29 2007
@@ -0,0 +1,27 @@
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+lib/Template/Declare.pm
+lib/Template/Declare/Tags.pm
+Makefile.PL
+MANIFEST			This list of files
+META.yml
+README
+SIGNATURE
+t/99-pod.t
+t/aliasing.t
+t/arg-declaration-styles.t
+t/importing.t
+t/indexhtml.t
+t/private.t
+t/self.t
+t/subclassing.t
+t/subtemplates.t
+t/trivial.t
+t/utils.pl
+t/xss.t

Modified: Template-Declare/META.yml
==============================================================================
--- Template-Declare/META.yml	(original)
+++ Template-Declare/META.yml	Thu Jan 18 00:13:29 2007
@@ -7,4 +7,4 @@
   directory: 
     - inc
     - t
-version: 0.01_01
+version: 0.02

Added: Template-Declare/README
==============================================================================
--- (empty file)
+++ Template-Declare/README	Thu Jan 18 00:13:29 2007
@@ -0,0 +1,186 @@
+Template::Declare(3)  User Contributed Perl Documentation Template::Declare(3)
+
+
+
+NNAAMMEE
+       Template::Declare - Perlish declarative templates
+
+SSYYNNOOPPSSIISS
+       "Template::Declare" is a pure-perl declarative HTML templating system.
+
+       Yes.  Another one. There are many others like it, but this one is ours.
+
+       A few key features and buzzwords
+
+       All templates are 100% pure perl code
+       Simple declarative syntax
+       No angle brackets
+       Mixins
+       Inheritance
+       Public and private templates
+
+UUSSAAGGEE
+       BBaassiicc uussaaggee
+
+        package MyApp::Templates;
+        use Template::Declare::Tags;
+        use base 'Template::Declare';
+
+        template simple => sub {
+           html {
+               head {}
+               body {
+                   p {'Hello, world wide web!'};
+                   }
+               }
+        };
+
+        package main;
+        use Template::Declare;
+        Template::Declare->init( roots => ['MyApp::Templates']);
+        print Template::Declare->show( 'simple');
+
+        # Output:
+        #
+        #
+        # <html>
+        #  <head></head>
+        #  <body>
+        #   <p>Hello, world wide web!
+        #   </p>
+        #  </body>
+        # </html>
+
+       AA sslliigghhttllyy mmoorree aaddvvaanncceedd eexxaammppllee
+
+       In this example, we'll show off how to set attributes on HTML tags, how
+       to call other templates and how to declare a _p_r_i_v_a_t_e template that
+       can't be called directly.
+
+        package MyApp::Templates;
+        use Template::Declare::Tags;
+        use base 'Template::Declare';
+
+        private template 'header' => sub {
+               head {
+                   title { 'This is a webpage'};
+                   meta { attr { generator => "This is not your father's frontpage"}}
+               }
+        };
+
+        template simple => sub {
+           html {
+               show('header');
+               body {
+                   p { attr { class => 'greeting'};
+                       'Hello, world wide web!'};
+                   }
+               }
+        };
+
+        package main;
+        use Template::Declare;
+        Template::Declare->init( roots => ['MyApp::Templates']);
+        print Template::Declare->show( 'simple');
+
+        # Output:
+        #
+        #  <html>
+        #  <head>
+        #   <title>This is a webpage
+        #   </title>
+        #   <meta generator="This is not your father&#39;s frontpage" />
+        #  </head>
+        #  <body>
+        #   <p class="greeting">Hello, world wide web!
+        #   </p>
+        #  </body>
+        # </html>
+
+       MMuullttiippllee tteemmppllaattee rroooottss ((sseeaarrcchh ppaatthhss))
+
+
+       IInnhheerriittaannccee
+
+
+       AAlliiaassiinngg
+
+
+MMEETTHHOODDSS
+       iinniitt
+
+       This _c_l_a_s_s _m_e_t_h_o_d initializes the "Template::Declare" system.
+
+       roots
+
+       sshhooww TTEEMMPPLLAATTEE__NNAAMMEE
+
+       Call "show" with a "template_name" and "Template::Declare" will render
+       that template and return the content as a scalar.
+
+       aalliiaass
+
+        alias Some::Clever::Mixin under '/mixin';
+
+       iimmppoorrtt
+
+        import Wifty::UI::something under '/something';
+
+       hhaass__tteemmppllaattee PPAACCKKAAGGEE TTEEMMPPLLAATTEE__NNAAMMEE SSHHOOWW__PPRRIIVVAATTEE
+
+       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.
+
+       rreessoollvvee__tteemmppllaattee TTEEMMPPLLAATTEE__PPAATTHH IINNCCLLUUDDEE__PPRRIIVVAATTEE__TTEEMMPPLLAATTEESS
+
+       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 tem-
+       plate we're looking for.
+
+       rreeggiisstteerr__tteemmppllaattee PPAACCKKAAGGEE TTEEMMPPLLAATTEE__NNAAMMEE CCOODDEERREEFF
+
+       This method registers a template called "TEMPLATE_NAME" in package
+       "PACKAGE". As you might guess, "CODEREF" defines the template's imple-
+       mentation.
+
+       rreeggiisstteerr__tteemmppllaattee PPAACCKKAAGGEE TTEEMMPPLLAATTEE__NNAAMMEE CCOODDEERREEFF
+
+       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.
+
+BBUUGGSS
+       Crawling all over, baby. Be very, very careful. This code is so cutting
+       edge, it can only be fashioned from carbon nanotubes.
+
+       Some specific bugs and design flaws that we'd love to see fixed
+
+       Output isn't streamy.
+
+       If you run into bugs or misfeatures, please report them to "bug-tem-
+       plate-declare at rt.cpan.org".
+
+SSEEEE AALLSSOO
+       Jifty
+
+AAUUTTHHOORR
+       Jesse Vincent <jesse at bestpractical.com>
+
+CCOOPPYYRRIIGGHHTT
+       Copyright 2006-2007 Best Practical Solutions, LLC
+
+
+
+perl v5.8.8                       2007-01-18              Template::Declare(3)

Modified: Template-Declare/SIGNATURE
==============================================================================
--- Template-Declare/SIGNATURE	(original)
+++ Template-Declare/SIGNATURE	Thu Jan 18 00:13:29 2007
@@ -14,19 +14,21 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 0d609920ce521fcce7ab41f517b43a6612f9e5c2 MANIFEST
-SHA1 003dd54215c1d09cc5208c4af1147bc2f8449288 META.yml
+SHA1 adb8f86d4b2efb4962a54716cbc5864e35a5abd5 MANIFEST
+SHA1 4d8127899c6a5051efaf5d42c4e54c882a9cc8a2 META.yml
 SHA1 af73eb5674f59ad3dbfe6db7b1d88209bb0ed70c Makefile.PL
-SHA1 c4e1a24413ee5acb9687db9b463b49bfb28ac521 inc/Module/Install.pm
-SHA1 e7c1c86f57b6778f4bdc7fd8c1b950e60ef41bc0 inc/Module/Install/Base.pm
-SHA1 e1829448769445cdaac384a888bf9ccf42e0d89a inc/Module/Install/Can.pm
-SHA1 70aa5e2055e8e38b4eecc5fc8c91762c0e97f551 inc/Module/Install/Fetch.pm
-SHA1 8ac832baf4f9e8e72d3e8f103cee6e8a94ac80e1 inc/Module/Install/Makefile.pm
-SHA1 0807e79d6dbfda4fcd3db0fc7df2e33e0cba263b inc/Module/Install/Metadata.pm
-SHA1 4da0a1fce2339cc3f8c296c7716480d2564d9470 inc/Module/Install/Win32.pm
-SHA1 9a903a1d178954ad864c7dcc98f9fa5c005d1553 inc/Module/Install/WriteAll.pm
-SHA1 7dadb951bc24d42f50f8b03cc11eee351f8cc920 lib/Template/Declare.pm
-SHA1 d28b002935e7751146b2e1364e029a6d6d25b567 lib/Template/Declare/Tags.pm
+SHA1 ac88cc91e2e25f60aec5d1a7b736c12a55641787 README
+SHA1 9b2f9d83bcf77860f53a0c07c90a4a59ad9f5df1 inc/Module/Install.pm
+SHA1 abe32855d75ab13747cf65765af9947b7a8c3057 inc/Module/Install/Base.pm
+SHA1 95b81d1e91bd634467bf633571eff4420e9c04eb inc/Module/Install/Can.pm
+SHA1 1fe98c63cf9d7271c8cb4183ba230f152df69e26 inc/Module/Install/Fetch.pm
+SHA1 2249171a2b72cd73ff2c0a06597d29f86e5df456 inc/Module/Install/Makefile.pm
+SHA1 381bb98ea3877bba49ae85e7a7ea130645fd3dbf inc/Module/Install/Metadata.pm
+SHA1 0c2118868ef82ac517eb6d9c3bd93e6eb9bbf83e inc/Module/Install/Win32.pm
+SHA1 e827d6d43771032fa3df35c0ad5e5698d0e54cda inc/Module/Install/WriteAll.pm
+SHA1 6ecec3a4273993a8089acff5c2c04a8f853f755f lib/Template/Declare.pm
+SHA1 c733d981160d21297f96e93ad8a16c23029559f2 lib/Template/Declare/Tags.pm
+SHA1 bb0da54f2b3f2d7955baa41ee458cb3d1887f475 t/99-pod.t
 SHA1 3863748e23eec0c1003f13262322d632f8760d0b t/aliasing.t
 SHA1 eb9e0fce94d7cab57425f639e65921e37fa2d2c5 t/arg-declaration-styles.t
 SHA1 a432327a9f6cc4cc2f4202c6c42f9b029d782767 t/importing.t
@@ -41,7 +43,7 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.3 (GNU/Linux)
 
-iD8DBQFFrRgHEi9d9xCOQEYRApaBAJ9xty+CuIUVzcMlRKBXEpNo96o1RwCgpQM3
-u46pLTOM4u7IvNf6iGf99Z4=
-=LpGS
+iD8DBQFFrwGnEi9d9xCOQEYRAv0hAJ9Q50qwSJmcDIwJ5gApNAsZAYBsvwCfbjWn
+8pgnSSOmvqphkVVeE7D2HfY=
+=e9p8
 -----END PGP SIGNATURE-----

Modified: Template-Declare/lib/Template/Declare.pm
==============================================================================
--- Template-Declare/lib/Template/Declare.pm	(original)
+++ Template-Declare/lib/Template/Declare.pm	Thu Jan 18 00:13:29 2007
@@ -4,7 +4,7 @@
 
 package Template::Declare;
 
-$Template::Declare::VERSION = "0.01_01";
+$Template::Declare::VERSION = "0.02";
 
 use base 'Class::Data::Inheritable';
 __PACKAGE__->mk_classdata('roots');


More information about the Jifty-commit mailing list