App-Mowyw

 view release on metacpan or  search on metacpan

script/mowyw  view on Meta::CPAN

This plugin may seem weird if you don't know Perl and its database module. If
that's the case, consider toying around with Perl and DBI first (it's really
worth a try).


=head1 CONFIGURATION FILE

Mowyw tries to read a file called C<mowyw.conf>. Within that file you can
configure include pathes and file names on a per-file base, and you can
specify which files should be processed.

An example config file might look like this:

    MATCH[german]    = \.de
    POSTFIX[german]  = .de
    MATCH[english]   = \.en
    POSTFIX[english] = .en

    INCLUDE[10]      = \.xhtml$
    EXCLUDE[50]      = _private

The first part defines two sections called "german" and "english". 
If a file matches the
regular expression C<\.de>, it is treated as being in section "german". All
include files will have the postfix '.de', which means that if a file is
called C<source/index.html.de>, the header file will be C<includes/header.de>, a
menu C<foo> will be searched for in file C<includes/menu-foo.de> etc.

This configuration mechanism is primarily intented for creating mutilingual
sites, but might be useful for other things as well.

The second part consists of C<INCLUDE> and C<EXCLUDE> statements with their
priority and the regex they match. Higher priority rules are tested first.
When a rule matches the file is either processed (in the case of an C<INCLUDE>
option) or just verbatimly copied (in case of an C<EXCLUDE> option). 

Due to an limition of the module that reads the config file
([mod://Config::File]) the
only way to specify rules with the same priority is to prefix them with
distinct strings:

    INCLUDE[a5] = foo
    INCLUDE[b5] = bar

is equivalent to
    
    INCLUDE[5]  = foo|bar

Don't give C<INCLUDE> and C<EXCLUDE>-options with the same priority, the
behaviour in that case is undefined.

=head1 SEE ALSO

If something isn't clear to you, please take a look into the  C<README> file
and the examples in the source tarball. If that doesn't answer your questions,
don't hesitate to contact the author.

The official website can be found here:
L<http://perlgeek.de/en/software/mowyw>.

=head1 BUGS AND LIMITATIONS
o
mowyw was written to get its author's job done, and it does that well. While
it was written with generality in mind, there are still some restrictions that
were accepted as a tradeoff for simplicity.

=over

=item 

Error messages from the lexer and parser aren't very useful for the uninitiated,
though the line
number makes it pretty obvious where to search for for the error.

=item 

Disk space: mowyw keeps two complete copies of a project on disk, the
source files and the resulting online files. This might not be optimal, and
consumes unnecessary space for files that are not processed anyway.

=item 

Memory: mowyw is written in Perl, which is not know to be terribly memory
efficient. Additionally it slurps the files into memory before parsing,
which isn't terribly efficient either. But it's simple, and if it's not
enough for you, go get a bigger machine (or contribute a stream tokenizer
and parser).

=item 

There are some limitations due to multi-pass parsing. For example you can't
include the string C<%]> in SQL statements, because it is considered to be a
tag closer by the lexer. A future rewrite might change that.

=back

=head1 AUTHOR

Written by Moritz Lenz, L<http://perlgeek.de/>, L<mailto:moritz@faui2k3.org>.

=head1 COPYRIGHT AND LICENSE

Copyright 2006 - 2011 by Moritz Lenz.

This is free software.  You may redistribute copies  of  it  under  the terms
of the Artistic License 2 as published by The Perl Foundation.

(If this license is not permissive enough for you, please contact the author).

There is NO WARRANTY, to the extent permitted by law.

=cut

# vim: sw=4 ts=4 expandtab



( run in 1.639 second using v1.01-cache-2.11-cpan-437f7b0c052 )