Mojo::DOM::Role::PrettyPrinter - Add a pretty printer method to Mojo::DOM
use Mojo::DOM; my $dom=Mojo::DOM->with_roles('+PrettyPrinter')->new('<div><h1>Loving it</h1></div>'); warn $dom->to_pretty_string; # <div> # <h1>Loving it</h1> # </div>
Support pretty printing XML documents. The original source for this function was extracted from XML::Loy.
Returns the current Mojo::DOM structure as indented XML.
Copyright (C) 2008-2017, Marcus Ramberg and Nils Diewald
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
Mojolicious, Mojolicious::Guides, http://mojolicious.org.
To install Mojo::DOM::Role::PrettyPrinter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojo::DOM::Role::PrettyPrinter
CPAN shell
perl -MCPAN -e shell install Mojo::DOM::Role::PrettyPrinter
For more information on module installation, please visit the detailed CPAN module installation guide.