<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Plack::App::Tags::HTML - Plack application for running Tags::HTML
    objects.

SYNOPSIS
     use Plack::App::Tags::HTML;

     my $obj = Plack::App::Tags::HTML-&gt;new(%parameters);
     my $app = $obj-&gt;to_app;

METHODS
    Class inherites Plack::Component::Tags::HTML.

  "new"
     my $obj = Plack::App::Tags::HTML-&gt;new(%parameters);

    Constructor.

    Returns instance of object.

    *       "component"

            Tags::HTML component.

            Option is required.

    *       "constructor_args"

            Tags::HTML component constructor arguments.

            Default value is undef.

    *       "data"

            Array data structure as input argument of Tags::HTML::process().

            Default value is undef.

    *       "data_css"

            Reference to array with structure for input argument of
            Tags::HTML::process_css().

            Default value is undef.

    *       "data_init"

            Reference to array with structure for input argument of
            Tags::HTML::init().

            This structure is used in init phase of each web app call.

            Default value is undef.

    *       "data_prepare"

            Reference to array with structure for input argument of
            Tags::HTML::prepare().

            This structure is used in prepare phase of web app run.

            Default value is undef.

  "to_app"
     my $app = $obj-&gt;to_app;

    Get code of plack application.

    Returns code of app.

ERRORS
     prepare_app():
             Cannot load component '%s'.
                     Error: %s
             Component must be a instance of 'Tags::HTML' class.

EXAMPLE1
     use strict;
     use warnings;

     use Plack::App::Tags::HTML;
     use Plack::Runner;

     # Run application.
     my $app = Plack::App::Tags::HTML-&gt;new(
             'component' =&gt; 'Tags::HTML::Stars',
             'data' =&gt; [{
                     1 =&gt; 'full',
                     2 =&gt; 'half',
                     3 =&gt; 'nothing',
             }],
     )-&gt;to_app;
     Plack::Runner-&gt;new-&gt;run($app);

     # Output:
     # HTTP::Server::PSGI: Accepting connections at http://0:5000/

     # &gt; curl http://localhost:5000/
     # &lt;!DOCTYPE html&gt;
     # &lt;html lang="en"&gt;&lt;head&gt;&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;&lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;&lt;style type="text/css"&gt;
     # *{box-sizing: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1wYXRoPSJ1cmwoI2VtcHR5KSIgLz4KICA8cG9seWdvbiBmaWxsPSIjZmRmZjAwIiBzdHJva2U9IiM2MDVhMDAiIHN0cm9rZS13aWR0aD0iMTUiIHBvaW50cz0iMTUwLDI1IDE3OSwxMTEgMjY5LDExMSAxOTcsMTY1IDIyMywyNTEgMTUwLDIwMCA3NywyNTEgMTAzLDE2NSAzMSwxMTEgMTIxLDExMSIgY2xpcC1wYXRoPSJ1cmwoI2ZpbGxlZCkiIC8+Cjwvc3ZnPgo=" /&gt;&lt;img src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAwcHgiIGhlaWdodD0iMjc1cHgiIHZpZXdCb3g9IjAgMCAzMDAgMjc1IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSI+CiAgPHBvbHlnb24gZmlsbD0ibm9uZSIgc3Ryb2tlPSIjODA4MDgwIiBzdHJva2Utd2lkdGg9IjE1IiBzdHJva2Utb3BhY2l0eT0iMC4zNzY0NzA2MCIgcG9pbnRzPSIxNTAsMjUgMTc5LDExMSAyNjksMTExIDE5NywxNjUgMjIzLDI1MSAxNTAsMjAwIDc3LDI1MSAxMDMsMTY1IDMxLDExMSAxMjEsMTExIiAvPgo8L3N2Zz4K" /&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;

EXAMPLE2
     use strict;
     use warnings;

     package App;

     use base qw(Tags::HTML);

     sub _process {
             my ($self, $value_hr) = @_;

             $self-&gt;{'tags'}-&gt;put(
                     ['b', 'div'],
                     ['a', 'class', 'my-class'],
                     ['d', join ',', @{$value_hr-&gt;{'foo'}}],
                     ['e', 'div'],
             );

             return;
     }

     sub _process_css {
             my $self = shift;

             $self-&gt;{'css'}-&gt;put(
                     ['s', '.my-class'],
                     ['d', 'border', '1px solid black'],
                     ['e'],
             );

             return;
     }

     package main;

     use Plack::App::Tags::HTML;
     use Plack::Runner;

     # Run application.
     my $app = Plack::App::Tags::HTML-&gt;new(
             'component' =&gt; 'App',
             'data' =&gt; [{
                     'foo' =&gt; [1, 2],
             }],
     )-&gt;to_app;
     Plack::Runner-&gt;new-&gt;run($app);

     # Output:
     # HTTP::Server::PSGI: Accepting connections at http://0:5000/

     # &gt; curl http://localhost:5000/
     # &lt;!DOCTYPE html&gt;
     # &lt;html lang="en"&gt;&lt;head&gt;&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;&lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;&lt;style type="text/css"&gt;
     # *{box-sizing:border-box;margin:0;padding:0;}.my-class{border:1px solid black;}
     # &lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div class="my-class"&gt;1,2&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;

DEPENDENCIES
    English, Error::Pure, Plack::Component::Tags::HTML,
    Plack::Util::Accessor, Symbol::Get.

SEE ALSO
    Tags::HTML
        Tags helper abstract class.

REPOSITORY
    &lt;https://github.com/michal-josef-spacek/Plack-App-Tags-HTML&gt;

AUTHOR
    Michal Josef Ĺ&nbsp;paÄŤek &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    Â© 2021-2024 Michal Josef Ĺ&nbsp;paÄŤek

    BSD 2-Clause License

VERSION
    0.16

</pre></body></html>