NAME

Error::Pure::Output::Tags::HTMLCustomPage - Error::Pure HTML output helper.

SYNOPSIS

use Error::Pure::Output::Tags::HTMLCustomPage qw(err_pretty);

err_pretty($tags_obj, $encoding, $content_type, $xml_version, $tags_structure_ar);

SUBROUTINES

err_pretty($tags_obj, $encoding, $content_type, $xml_version, $tags_structure_ar)
Helper routine use Tags $tags_obj object and print output to stdout.

EXAMPLE1

use strict;
use warnings;

use Error::Pure::Output::Tags::HTMLCustomPage qw(err_pretty);
use Tags::Output::Indent;

# Tags object.
my $tags = Tags::Output::Indent->new(
        'output_handler' => \*STDOUT,
        'auto_flush' => 1,
);

# Error.
err_pretty($tags, 'utf-8', 'application/xhtml+xml', '1.0', [
        ['b', 'html'],
        ['b', 'head'],
        ['b', 'title'],
        ['d', 'Foo'],
        ['e', 'title'],
        ['e', 'head'],
        ['b', 'div'],
        ['d', 'Bar'],
        ['e', 'div'],
        ['e', 'html'],
]);

# Output like:
# Cache-Control: no-cache
# Date: Wed, 03 Sep 2014 11:48:37 GMT
# Content-Type: application/xhtml+xml
#
# <?xml version="1.0" encoding="utf-8" standalone="no"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>
#   <head>
#     <title>
#       Foo
#     </title>
#   </head>
#   <div>
#     Bar
#   </div>
# </html>

EXAMPLE2

use strict;
use warnings;

use Error::Pure::Output::Tags::HTMLCustomPage qw(err_pretty);
use Tags::Output::Raw;

# Tags object.
my $tags = Tags::Output::Raw->new(
        'output_handler' => \*STDOUT,
        'auto_flush' => 1,
);

# Error.
err_pretty($tags, 'utf-8', 'application/xhtml+xml', '1.0', [
        ['b', 'html'],
        ['b', 'head'],
        ['b', 'title'],
        ['d', 'Foo'],
        ['e', 'title'],
        ['e', 'head'],
        ['b', 'div'],
        ['d', 'Bar'],
        ['e', 'div'],
        ['e', 'html'],
]);

# Output like:
# Cache-Control: no-cache
# Date: Wed, 03 Sep 2014 11:54:37 GMT
# Content-Type: application/xhtml+xml
#
# <?xml version="1.0" encoding="utf-8" standalone="no"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>Foo</title></head><div>Bar</div></html>

DEPENDENCIES

Exporter, HTTP::Headers::Fast, Readonly.

SEE ALSO

Task::Error::Pure

Install the Error::Pure modules.

REPOSITORY

https://github.com/michal-josef-spacek/Error-Pure-Output-Tags-HTMLCustomPage

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© 2014-2023 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.04