=head1 NAME

  Kwiki::PageTemplate - pre-fill kwiki page with this template

=head1 SYNOPSIS

Paste this into your SandBox and visit the SandBox.

  .page_template_fields
  page_id_prefix: Resume
  name: text
  gender:
      - Woman
      - Woman-in-man
  bio: textarea
  .page_template_fields

  .page_template
  = Resume form

  My name: {field:name}

  Email: {field:name}

  Biograph:
  {field:bio}
  .page_template

  Fill the above form and you will probabally get the job.

=head1 DESCRIPTION

This purpose of this plugin is to let your Kwiki User edit
pages even more easily. They only have to type some characters
into a given form, submit it, and done. Not even Kwiki formatter
syntax knowledged required.

The basic idea is from mac.com homepage-editing, they provide a nearly
WYSIWYG web interface to edit your homepage with many pre-defined HTML
templates. A Template is really a big form, after you submit that
form, what you just inputed replace the original input fields, becomes
the content of the generated page.

This plugin gives many wafl derivatives. The "page_template_fields"
wafl block is a YAML block where you can define your form variables,
and their input types, if the type is an array, it'll become a
pull-down select menu. After user submit the form, this plugin will
generate a page prefixed with the value
"page_template_page_id_prefix", default to "PageTemplateGenerated" in
your config/page_template.yaml, but you may specify "page_id_prefix"
in the page_template_fields wafl block to override this. The example
given in SYNOPSIS demostrate this feature. Sumbmitting the form would
generate a page named like "Resume3", the number afterwards are
increased automatically each time somebody submit the same form.

By default, the generated page will preserve same look as in the
"page_template" block. But if you want to display the generated page
in another look, you may write the template code in
"page_template_display" wafl block.

This plugin is still in its' early development and currently,
re-editing the generated page is not implemented, and something may
break in the future. So use it at your on risk.

=head1 VARIABLES

Here is a list of special variables that can be used to write a page
template.

=head1 COPYRIGHT

Copyright 2004,2005 by Kang-min Liu <gugod@gugod.org>.

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

See <http://www.perl.com/perl/misc/Artistic.html>
