NAME

App::Zapzi - store articles and publish them to read later

VERSION

version 0.013

DESCRIPTION

This class implements the application functions for Zapzi. See the page for the zapzi command for details on how to run it.

ATTRIBUTES

run

The current state of the application, -1 means nothing has been done, 0 OK, otherwise an error code. Used for exit code when the process terminates.

force

Option to force processing of the init command. Default is unset.

noarchive

Option to not archive articles on publication

long

Option to present a detailed listing

folder

Folder to work on. Default is 'Inbox'

transformer

Transformer to extract text from the article. Default is '', which means Zapzi will automatically the best option based on the content type of the text.

format

Format to publish a collection of folder articles in.

encoding

Encoding to publish a collection of folder articles in. Zapzi will select the best encoding for the content and publication format if not specified.

distribute

Method to distribute a published eBook - eg copy, script, email.

zapzi_dir

The folder where Zapzi files are stored.

zapzi_ebook_dir

The folder where Zapzi published eBook files are stored.

database

The instance of App:Zapzi::Database used by the application.

test_database

If set, use an in-memory database. Used to speed up testing only.

interactive

If set, this is an interactive session where Zapzi can prompt the user for input.

METHODS

get_app =method BUILD

At construction time, a copy of the application object is stored and can be retrieved later via get_app.

process_args(@args)

Read the arguments @args (normally you'd pass in @ARGV and process them according to the command line specification for the application.

init

Creates the database. Will only do so if the database does not exist already or if the force attribute is set.

init_config

On initialiseation, ask the user for settings for configuration variables. Will not ask if this is being run non-interactively.

config(@args)

Get or set configuration variables.

If args is 'get' will list out all variables and their values. If args is 'get x' will list the value of variable x. If args is 'set x y' will set the value of x to be y.

validate_folder

Determines if the folder specified exists.

validate_article_ids(@args)

Determines if @args could be article IDs.

list

Lists out the articles in folder.

list_folders

List folder names and article counts.

make_folder

Create one or more new folders. Will ignore any folders that already exist.

delete_folder

Remove one or more new folders. Will not allow removal of system folders ie Inbox and Archive, but will ignore removal of folders that do not exist.

delete_article

Remove an article from the database

add

Add an article to the database for later publication.

show(output, articles)

Exports article text. If output is 'browser' then will start a browser to view the article, otherwise it will print to STDOUT.

move

Move one or more articles to a folder.

publish

Publish a folder of articles to an eBook

help

Displays help text.

version

Displays version information.

AUTHOR

Rupert Lane <rupert@rupert-lane.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Rupert Lane.

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