The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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

# Pragmas.
use strict;
use warnings;

# Modules.
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

# Pragmas.
use strict;
use warnings;

# Modules.
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

HTTP::Headers::Fast, Readonly.

SEE ALSO

Task::Error::Pure

Install the Error::Pure modules.

REPOSITORY

https://github.com/tupinek/Error-Pure-Output-Tags-HTMLCustomPage

AUTHOR

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

http://skim.cz

LICENSE AND COPYRIGHT

© 2014-2015 Michal Špaček
BSD 2-Clause License

VERSION

0.03