Naoya Ito > Plack-Middleware-File-Less > Plack::Middleware::File::Less

Download:
Plack-Middleware-File-Less-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.02   Source  

SYNOPSIS ^

  use Plack::App::File;
  use Plack::Builder;

  builder {
      mount "/stylesheets" => builder {
          enable "File::Less";
          Plack::App::File->new(root => "./stylesheets");
      };
  };

  # Or with Middleware::Static
  enable "File::Less";
  enable "Static", path => qr/\.css$/, root => "./static";

DESCRIPTION ^

Plack::Middleware::File::Less is middleware that compiles Less templates into CSS stylesheet..

When a request comes in for .css file, this middleware changes the internal path to .less in the same directory. If the LESS template is found, a new CSS stylesheet is built on memory and served to the browsers. Otherwise, it falls back to the original .css file in the directory.

LESS BACKENDS ^

If you have the lessc executable available in your PATH, this module automatically uses the command to convert LESS into CSS. If the command is not available and you have CSS::LESSp perl module available, it will be used. Otherwise you'll get an exception during the initialization of this middleware component.

SEE ALSO ^

Plack::App::File CSS::LESSp http://lesscss.org/

AUTHORS ^

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: