<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Plack::Component::Tags::HTML - Plack component for Tags with HTML
    output.

SYNOPSIS
     package App;

     use base qw(Plack::Component::Tags::HTML);

     sub _cleanup {
            my $self = shift;
            # Cleanup about call().
            return;
     }

     sub _css {
            my $self = shift;
            $self-&gt;{'css'}-&gt;put(
                    # Structure defined by CSS::Struct
            );
            return;
     }

     sub _prepare_app {
            my $self = shift;
            # Preparation of app, before Plack::Component::call().
            return;
     }

     sub _process_actions {
            my ($self, $env) = @_;
            # Process actions in Plack::Component::call() before output.
            return;
     }

     sub _tags_middle {
            my $self = shift;
            $self-&gt;{'tags'}-&gt;put(
                    # Structure defined by Tags
            );
            return;
     }

DESCRIPTION
    This component is helper for creating Plack application with Tags. It is
    based on Plack::Component.

ACCESSOR METHODS
  "author"
    Author string to HTML head. Default value is undef.

  "content_type"
    Content type for output. Default value is 'text/html;
    charset=__ENCODING__'.

  "css"
    CSS::Struct::Output object. Default value is
    CSS::Struct::Output::Raw-&gt;new.

  "css_init"
    Reference to array with CSS::Struct structure. Default value is CSS
    initialization from Tags::HTML::Page::Begin like

     * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
     }

  "encoding"
    Set encoding for output. Default value is 'utf-8'.

  "favicon"
    Link to favicon. Default value is undef.

  "flag_begin"
    Flag that means begin of html writing via Tags::HTML::Page::Begin.
    Example is in EXAMPLE2. Default value is 1.

  "flag_end"
    Flag that means end of html writing via Tags::HTML::Page::End. Example
    is in EXAMPLE2. Default value is 1.

  "generator"
    Generator string to HTML head. Default value is undef.

  "psgi_app"
    PSGI application to run instead of normal process. Intent of this is
    change application in "_process_actions" method. Default value is undef.

  "script_js"
    Reference to array with Javascript code strings. Default value is [].

  "script_js_src"
    Reference to array with Javascript URLs. Default value is [].

  "status_code"
    HTTP status code. Default value is 200.

  "title"
    Title of page. Default value is undef.

  "tags"
    Tags::Output object. Default value is

     Tags::Output::Raw-&gt;new(
             'xml' =&gt; 1,
             'no_simple' =&gt; ['textarea'],
             'preserved' =&gt; ['pre'],
     ));

METHODS TO OVERWRITE
  "_cleanup"
    Method to cleanup after "call()". Argument is $self only.

  "_css"
    Method to set css via "$self-&gt;{'css'}" object. Argument is $self only.

  "_prepare_app"
    Method to set app preparation part. Called only once on start. Argument
    is $self only.

  "_process_actions"
    Method to set app processing part. Called in each call before creating
    of output. Argument is $self and $env.

  "_tags_middle"
    Method to set tags via "$self-&gt;{'tags'}" object. Argument is $self only.

METHODS IMPLEMENTED
  "call"
    Inherited from Plack::Component. There is run of:

     $self-&gt;_process_actions($env);
     $self-&gt;_css;
     $self-&gt;_tags;
     $self-&gt;_cleanup;

    After it Generate and encode output from Tags to output with HTTP code.
    HTTP status code is defined by "status_code()" method and Content-Type
    is defined by "content_type" method.

  "prepare_app"
    Initialize default values for:

     tags()
     css()
     encoding()
     content_type()
     status_code()

    and run _prepare_app().

ERRORS
     prepare_app():
             Accessor 'css' must be a 'CSS::Struct::Output' object.
             Accessor 'tags' must be a 'Tags::Output' object.

EXAMPLE1
     package App;

     use base qw(Plack::Component::Tags::HTML);
     use strict;
     use warnings;

     sub _tags_middle {
             my $self = shift;

             $self-&gt;{'tags'}-&gt;put(
                     ['d', 'Hello world'],
             );

             return;
     }

     package main;

     use Plack::Runner;

     my $app = App-&gt;new(
             'title' =&gt; 'My app',
     )-&gt;to_app;
     my $runner = Plack::Runner-&gt;new;
     $runner-&gt;run($app);

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

     # Output by HEAD to http://localhost:5000/:
     # 200 OK
     # Date: Sun, 31 Oct 2021 10:35:33 GMT
     # Server: HTTP::Server::PSGI
     # Content-Length: 166
     # Content-Type: text/html; charset=utf-8
     # Client-Date: Sun, 31 Oct 2021 10:35:33 GMT
     # Client-Peer: 127.0.0.1:5000
     # Client-Response-Num: 1

     # Output by GET to 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;title&gt;My app&lt;/title&gt;&lt;style type="text/css"&gt;
     # *{box-sizing:border-box;margin:0;padding:0;}
     # &lt;/style&gt;&lt;/head&gt;&lt;body&gt;Hello world&lt;/body&gt;&lt;/html&gt;

EXAMPLE2
     package App;

     use base qw(Plack::Component::Tags::HTML);
     use strict;
     use warnings;

     sub _tags_middle {
             my $self = shift;

             $self-&gt;{'tags'}-&gt;put(
                     ['d', 'Hello world'],
             );

             return;
     }

     package main;

     use Plack::Runner;

     my $app = App-&gt;new(
             'flag_begin' =&gt; 0,
             'flag_end' =&gt; 0,
             'title' =&gt; 'My app',
     )-&gt;to_app;
     my $runner = Plack::Runner-&gt;new;
     $runner-&gt;run($app);

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

     # Output by HEAD to http://localhost:5000/:
     # 200 OK
     # Date: Sun, 27 Feb 2022 18:52:59 GMT
     # Server: HTTP::Server::PSGI
     # Content-Length: 11
     # Content-Type: text/html; charset=utf-8
     # Client-Date: Sun, 27 Feb 2022 18:52:59 GMT
     # Client-Peer: 127.0.0.1:5000
     # Client-Response-Num: 1

     # Output by GET to http://localhost:5000/:
     # Hello world

DEPENDENCIES
    CSS::Struct::Output::Raw, Encode, Plack::Component,
    Plack::Util::Accessor, Scalar::Util, Tags::HTML::Page::Begin,
    Tags::HTML::Page::End, Tags::Output::Raw.

SEE ALSO
    Plack::Component
        Base class for PSGI endpoints

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

AUTHOR
    Michal Josef ﾅ�paﾄ稿k &lt;mailto:skim@cpan.org&gt;

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

LICENSE AND COPYRIGHT
    ﾂｩ 2020-2023 Michal Josef ﾅ�paﾄ稿k

    BSD 2-Clause License

VERSION
    0.11

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