App-FuguWeb

 view release on metacpan or  search on metacpan

lib/App/FuguWeb.pod  view on Meta::CPAN

    }

    page "install.html" {
            title    = Install
            markdown = INSTALL.md
    }

    manuals "Fugu" {
            dir       = man/fugu
            anchor    = fugu
            namespace = "Fugu::"
    }

    modules "OpenHAP modules" {
            dir    = lib/App/OpenHAP
            anchor = modules
    }

A C<page> block names exactly one source: C<body> for a fragment in the
source directory, C<markdown> for a Markdown file, or C<index = yes>
for the generated manual index. C<unlinked = yes> marks a page that no
other page links to, such as F<404.html>.

Three rules keep a list out of the file. A C<manuals> block reads its
directory. A C<modules> block finds every F<.pod> file below its
directory, and the sidecar that names the directory itself. Every file
in the source directory that the build does not render is an asset, and
the build copies it; L<App::FuguWeb::Site/ASSETS> says exactly which
those are.

L<App::FuguWeb::Config> documents every setting and every default.

=head1 FUNCTIONS

=head2 escape_html

    my $safe = App::FuguWeb::escape_html($text);

Escape C<&>, C<< < >> and C<< > >>, in that order. The function takes
bytes and returns bytes: no file in the namespace carries C<use utf8>,
so a multi-byte character passes through untouched.

=head2 escape_attr

    my $safe = App::FuguWeb::escape_attr($text);

The same, plus the double quote. Use it for a value on its way into a
double-quoted attribute: a value that holds a quote ends the attribute
early, and everything after it becomes markup. L</escape_html> alone
does not guard an attribute.

=head2 list_dir

    my $names = App::FuguWeb::list_dir($dir) or die "cannot read: $!";

The names in one directory, sorted, without C<.> and C<..>. The
function returns an array reference, or C<undef> with the reason in
C<$!>, so a caller can tell an empty directory from one it cannot
read.

The sort compares bytes and never reads the locale of the builder: a
site must not depend on the machine that built it.

=head2 path_below

    App::FuguWeb::path_below($path, $root)

Report whether C<$path> is C<$root> or lies below it. A trailing slash
on either does not change the answer. Both paths must be of the same
kind: both absolute, or both relative to the same directory.

=head1 CONSTANTS

=head2 CONFIG_FILE

The name of the configuration file, F<.fuguwebrc>. The name and the
discovery match F<.fuguvmrc>.

=head2 STYLESHEET

The name of the stylesheet in the output directory, F<style.css>. The
site is served from one flat directory, so every page links it under
that name and the build writes it there.

=head1 SEE ALSO

L<fuguweb(1)>, L<Fugu::Config>, mandoc(1), lowdown(1), L<pod2man>

=head1 AUTHOR

Dick Olsson <hi@senzilla.io>



( run in 0.618 second using v1.01-cache-2.11-cpan-a5162978ef8 )