From ac51972135b1c444903cc561881d265f244543da Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Fri, 10 Jun 2011 15:08:09 +0200 Subject: [PATCH] convert mowyw.1.txt to Pod. Also bump version to 0.7.0 --- Changelog | 4 + lib/App/Mowyw.pm | 2 +- mowyw.1.txt | 425 +++++++++++++++++++++++++++++------------------ 3 files changed, 272 insertions(+), 159 deletions(-) diff --git a/Changelog b/Changelog index da63bcb..79ed4e0 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +mowyw (0.7.0) + * lib/: revamped modules to live in the App:: namespace in preparation of + a CPAN release + * script/: new directory for the mowyw script mowyw (0.6.2) * lib/Mowyw/Datasource/XML.pm: more robust XML reading * example/: added missing files diff --git a/lib/App/Mowyw.pm b/lib/App/Mowyw.pm index afa3781..fc2f819 100644 --- a/lib/App/Mowyw.pm +++ b/lib/App/Mowyw.pm @@ -3,7 +3,7 @@ use strict; use warnings; #use warnings FATAL => 'all'; -our $VERSION = '0.6.2'; +our $VERSION = '0.7.0'; use App::Mowyw::Lexer qw(lex); use App::Mowyw::Datasource; diff --git a/mowyw.1.txt b/mowyw.1.txt index 489001c..1527b28 100644 --- a/mowyw.1.txt +++ b/mowyw.1.txt @@ -1,32 +1,27 @@ -MOWYW(1) -======== -Moritz Lenz +=head1 NAME +mowyw - Macro processor and Offline Content Management System -NAME ----- -mowyw - Offline content management system +=head1 SYNOPSIS -SYNOPSIS --------- - - *mowyw* - - *mowyw* `--make --source-prefix sp --destination-prefix dp --menu-prefix mp - --includes-prefix=ip --postifx=.html --quiet` + $ mowyw + $ mowyw --make --source-prefix sp --destination-prefix dp --menu-prefix mp + --includes-prefix=ip --postifx=.html --quiet + +=head1 DESCRIPTION -DESCRIPTION ------------ mowyw is a text processor for building static websites. It supports includes, menus, external datasources (like XML files or databases) and syntax hilighting. -To use mowyw you need three directories called *source*, *online* and -*includes*. `source` holds the source files that are to be interpreted by +To use mowyw you need three directories called B, B and +B. C holds the source files that are to be interpreted by mowyw. When you run mowyw, it will walk (recursively) through the source dir, -and for each file it either copies it verbatimely to `online`, or, if the file +and for each file it either copies it verbatimely to C, or, if the file looks like HTML (ends on .html, .shtml, .htm etc.) it is processed by mowyw, and the output is written into the online dir. -In `includes/` are include files (how surprising), header, footer, global +In C are include files (how surprising), header, footer, global include files, and optionally data source files. You should always execute mowyw from the parent directory of these three @@ -35,100 +30,189 @@ directories. The name of these three directories can be overridden with command line options. -COMMAND LINE OPTIONS --------------------- - - * `--make` - Only process files with a newer timestamp than the corresponding `online/' - file. - * `--quiet` - Don't produce diagnostics or progress output - * `--postfix` - Append the given postfix to the filename of all included file names (and - menu files). Defaults to the empty string. - * `--includes-prefix` - Change the search path for include files. Defaults to `includes/'. - * `--menu-prefix` - Change the search for menu files. Defaults to `includes/menu-`. - * `--destination-prefix` - Change the path for the output files. Defaults to `online/'. - * `--source-prefix` - Change the search path for source files. Defaults to `source/'. Must be a - directory. - * `--encoding` - Interpret all input files to have that encoding. Defaults to UTF-8. - (Conjecture: should default to the current locale... what to do?). - -All options except `--make` can be specified in a config file, with more +=head1 COMMAND LINE OPTIONS + +=over + +=item --make + +Only process files with a newer timestamp than the corresponding C +file. Note that this does not account for dependencies on include files and menu +files. + +=item --quiet + +Don't produce diagnostics or progress output + +=item --postfix + +Append the given postfix to the filename of all included file names (and +menu files). Defaults to the empty string. + +=item --includes-prefix + +Change the search path for include files. Defaults to C. + +=item --menu-prefix + +Change the search for menu files. Defaults to C. + +=item --destination-prefix + +Change the path for the output files. Defaults to C. + +=item --source-prefix + +Change the search path for source files. Defaults to C. Must be a +directory. + +=item --encoding + +Interpret all input files to have that encoding. Defaults to UTF-8. +(Conjecture: should default to the current locale... what to do?). + +=back + +All options except C<--make> can be specified in a config file, with more customization options. -PROCESSING ORDER ----------------- +=head1 PROCESSING ORDER + mowyw processes files in several steps: - * The file *mowyw.conf* is read (if it exists) - * The source directory is traversed - * For all source file that is actually processed - - the file *includes/global* is read, if it exists - - the current file is read, all markup is processed - - the file *includes/header* is processed and prepended to the current - output file - - the file *includes/footer* is processed and appended to the current - output file - -MARKUP ------- +=over + +=item + +The file *mowyw.conf* is read (if it exists) + +=item + +The source directory is traversed + +=item + +For all source file that is actually processed + +=over 8 + +=item - + +the file C is read, if it exists + +=item - + +the current file is read, all markup is processed + +=item - + +the file C is processed and prepended to the current +output file + +=item - + +the file C is processed and appended to the current +output file + +=back + +=back + + +=head1 MARKUP + Normal text (including HTML markup) is copied verbatimely to the output file. -Special directives are delimited either with `[% ... %]` (preferred) or with -`[[[ ... ]]]` (deprecated, but still supported for compatibility). +Special directives are delimited either with C<[% ... %]> (preferred) or with +C<[[[ ... ]]]> (deprecated, but still supported for compatibility). Many elements take options, which are usually whitespace delimited, for -example `[% include includefile.html %]`. +example C<[% include includefile.html %]>. Inline elements consist only of one tag, while block elements run until the matching end tag. The following inline elements are supported: - * `include` includes a file, and processes it. Example: `[% include - coypright.html %]`. - * `menu` refers to a menu. See section <> below. - * `item` defines a menu item. See section <> below. - * `option` sets an option, for example `[% option no-header %]`. See section - <> below. - * `comment` ignores everything up to the tag end. Example: `[% comment this - comments appears nowhere in the output %]`. - * `setvar` sets a variable. Example: `[% setvar title Title of this page%]`. - * `readvar` reads and outputs a variable. You can optionally specify an - escape mechanism. Example: `

[% readvar title %]

` or `[% readvar - db.column escape:html %]`. - * `bind` binds a variable to a datasource. See section <> below. +=over + +=item + +C includes a file, and processes it. Example: +C<`[% include coypright.html %]>. + +=item + +C refers to a menu. See section L below. + +=item + +C defines a menu item. See section L below. + +=item + +C