#!/usr/bin/perl
# Create the documentation for the Math::Polygon distribution.
# This script can be called as part of the mkdist procedure, but also
# on its own.

use warnings;
use strict;

use lib '../OODoc/lib';  # the next release of OODoc software ;-)

use OODoc;

my $verbose      = $ARGV[0] || 0;

##### Synchronize these constants with the mkdist script.
my $workdir      = '/tmp/MathPoly';

##### Other constants
my $distribution = 'Math::Polygon';
my $name         = 'Polygon calculation';

my $pod_format   = 'pod2';         # install Bundle::Text::MagicTemplate first
#my $pod_format  = 'pod';          # runs out-of-the-box
my $website      = 'http://perl.overmeer.net/geo';

#
# The OODoc object is created.  It is used to collect all the manual
# information in.
#

my $doc  = OODoc->new
 ( distribution  => $name
 , verbose       => $verbose
 );

my $version      = $doc->version;
print "*** Producing $distribution version $version\n" if $verbose;

#
# Reading all the manual pages
# This could be called more than once to combine different sets of
# manual pages in different formats.
#

print "* Processing files\n" if $verbose;
$doc->processFiles(workdir => $workdir);

#
# Prepare the collected information
# Expanding the inheritance relations and such, to simplify the
# production of manual pages in their different formats.
#

print "* Preparation phase\n" if $verbose;
$doc->prepare;

#
# Create POD
# Produce manual pages in the usual Perl style.
#

print "* Creating POD\n" if $verbose;

$doc->create
  ( $pod_format
  , workdir => $workdir
  , append => <<TEXT);

=head1 REFERENCES

See the $distribution website at L<$website> for more details.

=head1 COPYRIGHTS

Module version $version.
Written by Mark Overmeer (polygon\@overmeer.net).  See the ChangeLog for
other contributors.

Copyright (c) 2004 by the author(s). All rights reserved.  This program
is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.

TEXT
