[Catalyst-commits] r9224 - in Catalyst-View-TT-XHTML/1.000/trunk:
lib/Catalyst/View/ContentNegotiation lib/Catalyst/View/TT t
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Thu Feb 5 23:16:21 GMT 2009
Author: t0m
Date: 2009-02-05 23:16:21 +0000 (Thu, 05 Feb 2009)
New Revision: 9224
Modified:
Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/ContentNegotiation/XHTML.pm
Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/TT/XHTML.pm
Catalyst-View-TT-XHTML/1.000/trunk/t/podspelling.t
Log:
Reformat docs, couple of other misc dinks
Modified: Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/ContentNegotiation/XHTML.pm
===================================================================
--- Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/ContentNegotiation/XHTML.pm 2009-02-05 22:08:14 UTC (rev 9223)
+++ Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/ContentNegotiation/XHTML.pm 2009-02-05 23:16:21 UTC (rev 9224)
@@ -55,9 +55,8 @@
=head1 NAME
-Catalyst::View::ContentNegotiation::XHTML - Adjusts the
-response Content-Type header to application/xhtml+xml
-if the browser accepts it.
+Catalyst::View::ContentNegotiation::XHTML - Adjusts the response Content-Type
+header to application/xhtml+xml if the browser accepts it.
=head1 SYNOPSIS
@@ -73,19 +72,18 @@
=head1 DESCRIPTION
-This is a simple Role which sets the response C<Content-Type> to be
-C<application/xhtml+xml> if the users browser sends an C<Accept> header
+This is a simple Role which sets the response C<Content-Type> to be
+C<application/xhtml+xml> if the users browser sends an C<Accept> header
indicating that it is willing to process that MIME type.
-Changing the C<Content-Type> to C<application/xhtml+xml> causes
-browsers to interpret the page as XML, meaning that your markup must
-be well formed.
+Changing the C<Content-Type> to C<application/xhtml+xml> causes browsers to
+interpret the page as XML, meaning that your markup must be well formed.
=head1 CAVEATS
-This is useful when you're developing your application, as you know that
-all pages you view are parsed as XML, so any errors caused by your markup
-not being well-formed will show up at once.
+This is useful when you're developing your application, as you know that all
+pages you view are parsed as XML, so any errors caused by your markup not
+being well-formed will show up at once.
Whilst this module is has been tested against most popular browsers including
Internet Explorer, it may cause unexpected results on browsers which do not
@@ -95,24 +93,25 @@
=head2 after process
-Changes the response C<Content-Type> if appropriate (from the requests C<Accept> header).
+Changes the response C<Content-Type> if appropriate (from the requests
+C<Accept> header).
=head1 METHODS
=head2 pragmatic_accept
-Some browsers (such as Internet Explorer) have a nasty way of sending
-Accept */* and this claiming to support XHTML just as well as HTML.
-Saving to a file on disk or opening with another application does
-count as accepting, but it really should have a lower q value then
-text/html. This sub takes a pragmatic approach and corrects this mistake
-by modifying the Accept header before passing it to content negotiation.
+Some browsers (such as Internet Explorer) have a nasty way of sending Accept
+*/* and this claiming to support XHTML just as well as HTML. Saving to a file
+on disk or opening with another application does count as accepting, but it
+really should have a lower q value then text/html. This sub takes a pragmatic
+approach and corrects this mistake by modifying the Accept header before
+passing it to content negotiation.
=head1 ATTRIBUTES
=head2 variants
-Returns an array ref of 3 part arrays, comprising name, priority, output
+Returns an array ref of 3 part arrays, comprising name, priority, output
mime-type, which is used for the content negotiation algorithm.
=head1 PRIVATE METHODS
@@ -127,30 +126,36 @@
=item L<Catalyst::View::TT::XHTML> - Trivial Catalyst TT view using this role.
-=item L<http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html> - Content negotiation RFC.
+=item L<http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html> - Content
+negotiation RFC.
=back
=head1 BUGS
-Should be split into a base ContentNegotiation role which is consumed by ContentNegotiation::XHTML.
+Should be split into a base ContentNegotiation role which is consumed by
+ContentNegotiation::XHTML.
=head1 AUTHOR
-Tomas Doran (t0m) C<< <bobtfish at bobtfish.net> >>
+Original author and maintainer - Tomas Doran (t0m)
+C<< <bobtfish at bobtfish.net> >>
=head1 CONTRIBUTORS
=over
-=item David Dorward - test patches and */* pragmatism.
+=item David Dorward - test patches and */* pragmatism to make it work for
+browsers which aren't firefox.
-=item Florian Ragwitz (rafl) C<< <rafl at debian.org> >> - Conversion into a Moose Role
+=item Florian Ragwitz (rafl) C<< <rafl at debian.org> >> - Conversion into a
+Moose Role, which is what the module should have been originally.
=back
=head1 COPYRIGHT
-This module itself is copyright (c) 2008 Tomas Doran and is licensed under the same terms as Perl itself.
+This module itself is copyright (c) 2008 Tomas Doran and is licensed under the
+same terms as Perl itself.
=cut
Modified: Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/TT/XHTML.pm
===================================================================
--- Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/TT/XHTML.pm 2009-02-05 22:08:14 UTC (rev 9223)
+++ Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/TT/XHTML.pm 2009-02-05 23:16:21 UTC (rev 9224)
@@ -3,8 +3,10 @@
use Moose;
use namespace::clean -except => 'meta';
-extends qw/Catalyst::View::TT/;
-with qw/Catalyst::View::ContentNegotiation::XHTML/;
+BEGIN { # You can have chain endpoints in your view if you smoked enough crack..
+ extends qw/Catalyst::View::TT/;
+ with qw/Catalyst::View::ContentNegotiation::XHTML/;
+}
our $VERSION = '1.100';
@@ -14,8 +16,8 @@
=head1 NAME
-Catalyst::View::TT::XHTML - A sub-class of the standard TT view which
-serves application/xhtml+xml content if the browser accepts it.
+Catalyst::View::TT::XHTML - A sub-class of the standard TT view which serves
+application/xhtml+xml content if the browser accepts it.
=head1 SYNOPSIS
@@ -28,32 +30,37 @@
=head1 DESCRIPTION
-This is a very simple sub-class of L<Catalyst::View::TT>, which sets
-the response C<Content-Type> to be C<application/xhtml+xml> if the
-user's browser sends an C<Accept> header indicating that it is willing
-to process that MIME type.
+This is a very simple sub-class of L<Catalyst::View::TT>, which sets the
+response C<Content-Type> to be C<application/xhtml+xml> if the user's browser
+sends an C<Accept> header indicating that it is willing to process that MIME
+type.
-Changing the C<Content-Type> causes browsers to interpret the page as
-XML, meaning that the markup must be well formed.
+Changing the C<Content-Type> causes browsers to interpret the page as XML,
+meaning that the markup must be well formed.
-This is useful when you're developing your application, as you know that
-all pages you view are parsed as XML, so any errors caused by your markup
-not being well-formed will show up at once.
+This is useful when you're developing your application, as you know that all
+pages you view are parsed as XML, so any errors caused by your markup not
+being well-formed will show up at once.
=head1 NOTE
-This module is a very simple demonstration of a consumer of the
-L<Catalyst::View::ContentNegotiation::XHTML> role.
+This module is a very simple demonstration of a consumer of the
+L<Catalyst::View::ContentNegotiation::XHTML> role.
-If your needs are not trivial, then it is recommended that you consume
-that role yourself.
+If your needs are not trivial, then it is recommended that you consume that
+role yourself.
=head1 AUTHOR
-Tomas Doran (t0m) C<< <bobtfish at bobtfish.net> >>
+Original author and maintainer - Tomas Doran (t0m)
+C<< <bobtfish at bobtfish.net> >>
+Now mostly the work of other, smarter people - see
+L<Catalyst::View::ContentNegotiation::XHTML>.
+
=head1 COPYRIGHT
-This module itself is copyright (c) 2008 Tomas Doran and is licensed under the same terms as Perl itself.
+This module itself is copyright (c) 2008 Tomas Doran and is licensed under the
+same terms as Perl itself.
=cut
Modified: Catalyst-View-TT-XHTML/1.000/trunk/t/podspelling.t
===================================================================
--- Catalyst-View-TT-XHTML/1.000/trunk/t/podspelling.t 2009-02-05 22:08:14 UTC (rev 9223)
+++ Catalyst-View-TT-XHTML/1.000/trunk/t/podspelling.t 2009-02-05 23:16:21 UTC (rev 9224)
@@ -21,3 +21,4 @@
rafl
ContentNegotiation
Ragwitz
+firefox
More information about the Catalyst-commits
mailing list