The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::Dapper - A publishing platform for static websites

VERSION

Version 0.01

SYNOPSIS

Dapper allows you to transform simple text files into websites. By installing the App::Dapper Perl module, a dapper executable will be available to you in your Terminal window. You can use this executable in a number of ways:

    # Initialize the current directory with a fresh skeleton of a site
    $ dapper init

    # Build the site
    $ dapper build

    # Serve the site locally at http://localhost:8000
    $ dapper serve

    # Watch the source dir, layout dir, and config file for changes
    # If changes are detected, rebuild the site
    $ dapper watch

    # Get help on additional ways to use the dapper executable
    $ dapper -h

    # Print the version
    $ dapper -v

    # Build site using "posts" as the source directory
    # Note this may also be specified in the config file
    $ dapper -s "posts" build

    # Build site using "templates" as the layout directory
    # Note this may also be specified in the config file
    $ dapper -l templates build

    # Build site using "site" as the output directory
    # Note this may also be specified in the config file
    $ dapper -o site build

    # Build site using "project.yml" as the config file
    $ dapper -c project.yml build

Additionally, Dapper may be used as a perl module directly. Examples:

    use App::Dapper;

    # Initialize a skeleton Dapper site in the current directory
    my $d = App::Dapper->new();
    $d->init();
    undef $d;

    # Build the site
    my $d = App::Dapper->new();
    $d->build();
    undef $d;

    # Serve the site locally at http://localhost:8000
    my $d = App::Dapper->new();
    $d->serve();
    undef $d;

METHODS

new

Create a new Dapper object. Example:

    my $d = App::Dapper->new();

Alternatively, the source dir, output dir, layout dir, and configuration file may be specified. Example:

    my $d = App::Dapper->new("_source", "_output", "_layout", "_config.yml");

Defaults are as follows:

<source> = "_source"
<output> = "_output"
<layout> = "_layout"
<config> = "_config.yml"

After creating a Dapper object, the followin hash elements may be accessed:

    use App::Dapper;

    my $d = App::Dapper->new();

    print "Source directory: $d->{source}\n";
    print "Output directory: $d->{output}\n";
    print "Layout directory: $d->{layout}\n";
    print "Config file: $d->{config}\n";
    print "Object instantiation time: $d->{site}->{time}\n";

init

Initializes a new skeleton project in the current directory (of the calling script, and uses the defined source dir, output dir, layout dir, and config file. Example usage:

    use App::Dapper;

    my $d = App::Dapper->new();
    $d->init();

After running this method, the following directory structure will be created:

    ├── _config.yml
    ├── _layout/
    │  └── index.html
    └── _source/
        └── index.md

build

Build the site. Example:

    use App::Dapper;
    
    my $d = App::Dapper->new();
    $d->build();

When the site is built, it is done in three steps:

1. Parse. In this step, the configuration file is read. In addition, all the source files in the source directory as well as the layout files in the layout directory are reach and stored in the site hash.

2. Transform. Combine source and layout files.

3. Render. Save output files to the output directory.

parse

Parse the source directory, config file, and templates.

transform

Walk the source and output directories and transform the text into the output files.

render

Render the internal hash of source files, config file, and layouts into the actual output files on disk.

serve

Serve the site locally. Pass in the port number. The port number will be used to serve the site contents from the output directory like this: http://localhost:<port>. Here is an example, using the default port 8000:

    use App::Dapper;

    my $d = App::Dapper->new();
    $d->serve("8000");

The following is equivalent:

    $d->serve();

read_project

Read the project file.

read_templates

Read the content of the templates specified in the project configuration file.

walk

Walk the source directory and output directory and build the site hash.

taj_mahal

Build the internal hash of files, configurations, and layouts.

copy(sourcedir, outputdir)

Copies files and directories from <sourcedir> to <outputdir> as long as they do not made what is contained in $self->{site}->{ignore}.

AUTHOR

Mark Benson, <markbenson at vanilladraft.com>

BUGS

Please report any bugs or feature requests to bug-text-dapper at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-Dapper. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc App::Dapper

You can also look for information at:

LICENSE AND COPYRIGHT

The MIT License (MIT)

Copyright (c) 2002-2014 Mark Benson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 182:

Non-ASCII character seen before =encoding in '├──'. Assuming UTF-8