=pod =head1 NAME App::WRT - WRiting Tool, a static site/blog generator and related utilities =for HTML =head1 SYNOPSIS Using the commandline tools: $ mkdir project $ cd project $ wrt init # set up some defaults $ wrt config # dump configuration values $ wrt ls # list entries $ wrt display new # print HTML for new entries to stdout $ wrt render-all # publish HTML to project/public/ Using App::WRT in library form: #!/usr/bin/env perl use App::WRT; my $w = App::WRT->new( entry_dir => 'archives', url_root => '/', # etc. ); print $w->display(@ARGV); =head1 INSTALLING It's possible but not likely this would run on a Perl as old as 5.10.0. In practice, I know that it works under 5.26.2. It should be fine on any reasonably modern Linux distribution, and may work on MacOS or a BSD of your choosing. It's possible that it would run under the Windows Subsystem for Linux, but it would definitely fail under vanilla Windows; it currently makes too many assumptions about things like directory path separators and filesystem semantics. (Although I would like the code to be more robust across platforms, this is not a problem I feel much urgency about solving at the moment, since I'm pretty sure I am the only user of this software. Patches would certainly be welcome.) To install the latest development version from the main repo: $ git clone https://code.p1k3.com/gitea/brennen/wrt.git $ cd wrt $ perl Build.PL $ ./Build installdeps $ ./Build test $ ./Build install To install the latest version released on CPAN: $ cpanm App::WRT Or: $ cpan -i App::WRT You will likely need to use C or C to get a systemwide install. =head1 DESCRIPTION This started life somewhere around 2001 as C, a CGI script to concatenate fragments of handwritten HTML by date. It has since accumulated several of the usual weblog features (lightweight markup, feed generation, embedded Perl, poetry tools, image galleries, and ill-advised dependencies), but the basic idea hasn't changed that much. The C utility now generates static HTML files, instead of expecting to run as a CGI script. This is a better idea, for the most part. By default, entries are stored in a simple directory tree under C. Like: archives/2001/1/1 archives/2001/1/2/index archives/2001/1/2/sub_entry Which will publish files like so: public/index.html public/all/index.html public/2001/index.html public/2001/1/index.html public/2001/1/1/index.html public/2001/1/2/index.html public/2001/1/2/sub_entry/index.html Contents will be generated for each year and for the entire collection of dated entries. Month indices will consist of all entries for that month. A top-level index file will consist of the most recent month's entries. It's possible (although not as flexible as it ought to be) to redefine the directory layout. (See C<%default{entry_map}> below.) An entry may be either a plain UTF-8 text file, or a directory containing several such files. If it's a directory, a file named "index" will be treated as the text of the entry, and all other lower-case filenames without extensions will be treated as sub-entries or documents within that entry, and displayed accordingly. Links to certain other filetypes will be displayed as well. Directories may be nested to an arbitrary depth, although it's probably not a good idea to go very deep with the current display logic. A PNG or JPEG file with a name like 2001/1/1.icon.png 2001/1/1/index.icon.png 2001/1/1/whatever.icon.png 2001/1/1/whatever/index.icon.png will be treated as an icon for the corresponding entry file. =head2 MARKUP Entries may consist of hand-written HTML (to be passed along without further interpretation), a supported form of lightweight markup, or some combination thereof. Actually, an entry may consist of any darn thing you please, as long as Perl will agree that it is text, but presumably you're going to be feeding this to a browser. Header tags (

,

, etc.) will be used to display titles in feeds and other places. Other special markup is indicated by a variety of HTML-like container tags. B - evaluated and replaced by whatever value you return (evaluated in a scalar context): my $dog = "Ralph."; return $dog; This code is evaluated before any other processing is done, so you can return any other markup understood by the script and have it handled appropriately. B - actually keys to the hash underlying the App::WRT object, for the moment: $self->title("About Ralph, My Dog"); return '';

The title is ${title}.

This is likely to change at some point, so don't build anything too elaborate on it. Embedded code and variables are intended only for use in the F