<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Plack::App::Directory::PYX - Plack PYX directory application.

SYNOPSIS
     use Plack::App::Directory::PYX;

     my $obj = Plack::App::File-&gt;new(%parameters);
     my $psgi_ar = $obj-&gt;serve_path($env, $path_to_file_or_dir);
     my $app = $obj-&gt;to_app;

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

    Constructor.

    Returns instance of object.

    *   "indent"

        Set indent of SGML output.

  "serve_path"
     my $psgi_ar = $obj-&gt;serve_path($env, $path_to_file_or_dir);

    Process file or directory on disk and serve it to application.

    Returns reference to array (PSGI structure).

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

    Creates Plack application.

    Returns Plack::Component object.

EXAMPLE1
     use strict;
     use warnings;

     use File::Temp;
     use IO::Barf;
     use Plack::App::Directory::PYX;
     use Plack::Runner;

     # Temporary file with PYX.
     my $temp_pyx_file = File::Temp-&gt;new-&gt;filename;

     # PYX file.
     my $pyx = &lt;&lt;'END';
     (html
     (head
     (title
     -Title
     )title
     )head
     (body
     (div
     -Hello world
     )div
     )body
     )html
     END
     barf($temp_pyx_file, $pyx);

     # Run application with one PYX file.
     my $app = Plack::App::Directory::PYX-&gt;new('file' =&gt; $temp_pyx_file)-&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;html&gt;&lt;head&gt;&lt;title&gt;Title&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;div&gt;Hello world&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;

EXAMPLE2
     use strict;
     use warnings;

     use File::Temp;
     use IO::Barf;
     use Plack::App::Directory::PYX;
     use Plack::Runner;

     # Temporary file with PYX.
     my $temp_pyx_file = File::Temp-&gt;new-&gt;filename;

     # PYX file.
     my $pyx = &lt;&lt;'END';
     (html
     (head
     (title
     -Title
     )title
     )head
     (body
     (div
     -Hello world
     )div
     )body
     )html
     END
     barf($temp_pyx_file, $pyx);

     # Run application with one PYX file.
     my $app = Plack::App::Directory::PYX-&gt;new(
             'file' =&gt; $temp_pyx_file,
             'indent' =&gt; 1,
     )-&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;html&gt;
     #   &lt;head&gt;
     #     &lt;title&gt;
     #       Title
     #     &lt;/title&gt;
     #   &lt;/head&gt;
     #   &lt;body&gt;
     #     &lt;div&gt;
     #       Hello world
     #     &lt;/div&gt;
     #   &lt;/body&gt;
     # &lt;/html&gt;

DEPENDENCIES
    Plack::App::Directory, PYX::SGML::Tags, Tags::Output::Raw,
    Unicode::UTF8,

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

AUTHOR
    Michal Josef Е&nbsp;paДЌek &lt;mailto:skim@cpan.org&gt;

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

LICENSE AND COPYRIGHT
    В© 2016-2020 Michal Josef Е&nbsp;paДЌek

    BSD 2-Clause License

VERSION
    0.02

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