From: Tomas Doran Date: Fri, 19 Feb 2010 00:26:50 +0000 (+0000) Subject: Update README X-Git-Tag: 0.07_03~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-View-Component-SubInclude.git;a=commitdiff_plain;h=340929a7a27069a35e606a09dfe453487325574b Update README --- diff --git a/Changes b/Changes index 99053dc..8314dfb 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Catalyst-View-Component-SubInclude - - Fix missing test_requires dependency on parent by dropping use of + - Autogenerate README file from Pod. + - Fix missing test_requires dependency on parent by dropping use of that module. 0.07_02 Fri Feb 19 00:11:00 2010 diff --git a/Makefile.PL b/Makefile.PL index 4f426cc..fa12b05 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -27,5 +27,10 @@ catalyst; resources repository => 'git://git.shadowcat.co.uk/catagits/Catalyst-View-Component-SubInclude'; +if ($Module::Install::AUTHOR) { + system("pod2text lib/Catalyst/View/Component/SubInclude.pm > README") + and die $! +} + auto_install; WriteAll; diff --git a/README b/README index 4988a16..c21c34b 100644 --- a/README +++ b/README @@ -3,7 +3,21 @@ NAME views VERSION - Version 0.07 + Version 0.07_01 + +SYNOPSIS + package MyApp::View::TT; + use Moose; + + extends 'Catalyst::View::TT'; + with 'Catalyst::View::Component::SubInclude'; + + __PACKAGE__->config( subinclude_plugin => 'SubRequest' ); + + Then, somewhere in your templates: + + [% subinclude('/my/widget') %] + [% subinclude_using('SubRequest', '/page/footer') %] DESCRIPTION "Catalyst::View::Component::SubInclude" allows you to include content in @@ -19,20 +33,83 @@ DESCRIPTION other sub-include plugin you might want to implement. An LWP plugin seems useful and might be developed in the future. +STASH FUNCTIONS + This component does its magic by exporting a "subinclude" coderef entry + to the stash. This way, it's easily accessible by the templates (which + is the most common use-case). + + "subinclude( $path, @args )" + This will render and return the body of the included resource (as + specified by $path) using the default subinclude plugin. + + "subinclude_using( $plugin, $path, @args )" + This will render and return the body of the included resource (as + specified by $path) using the specified subinclude plugin. + + The "subinclude" function above is implemented basically as a shortcut + which calls this function using the default plugin as the first + parameter. + +SUBINCLUDE PLUGINS + The module comes with two subinclude plugins: SubRequest, Visit and ESI. + + By default, the "SubRequest" plugin will be used. This can be changed in + the view's configuration options (either in the config file or in the + view module itself). + + Configuration file example: + + + subinclude_plugin ESI + + + "set_subinclude_plugin( $plugin )" + This method changes the current active subinclude plugin in runtime. It + expects the plugin suffix (e.g. "ESI" or "SubRequest") or a + fully-qualified class name in the + "Catalyst::View::Component::SubInclude" namespace. + + Writing plugins + If writing your own plugin, keep in kind plugins are required to + implement a class method "generate_subinclude" with the following + signature: + + sub generate_subinclude { + my ($class, $c, @args) = @_; + } + + The default plugin is stored in the "subinclude_plugin" which can be + changed in runtime. It expects a fully qualified class name. + SEE ALSO Catalyst::Plugin::SubRequest, Moose::Role, Moose, +BUGS + Please report any bugs or feature requests to + "bug-catalyst-view-component-subinclude at rt.cpan.org", or through the + web interface at + . I will be notified, and then you'll automatically be + notified of progress on your bug as I make changes. + AUTHOR Nilson Santos Figueiredo Junior, "" +CONTRIBUTORS + Tomas Doran (t0m) ". COPYRIGHT & LICENSE + Copyright (C) 2010 Nilson Santos Figueiredo Junior and the above + contributors. + Copyright (C) 2009 Nilson Santos Figueiredo Junior. Copyright (C) 2009 Ionzero LLC. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. +