package SQL::Translator::Producer::POD;
# -------------------------------------------------------------------
-# $Id: POD.pm,v 1.1 2003-06-09 05:37:04 kycl4rk Exp $
+# $Id: POD.pm,v 1.2 2003-06-10 03:49:35 kycl4rk Exp $
# -------------------------------------------------------------------
# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>
#
use strict;
use vars qw[ $VERSION ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/;
use SQL::Translator::Schema::Constants;
use SQL::Translator::Utils qw(header_comment);
#
# Fields
#
- for my $field ( $table->get_fields ) {
+ for my $field ( @fields ) {
$pod .= "=head4 " . $field->name . "\n\n=over 4\n\n";
my $data_type = $field->data_type;
join(', ', $c->fields ) . "\n\n";
if ( $c->type eq FOREIGN_KEY ) {
- $pod .= "=item * Reference Table = " .
- $c->reference_table . "\n\n";
+ $pod .= "=item * Reference Table = L</" .
+ $c->reference_table . ">\n\n";
$pod .= "=item * Reference Fields = " .
- join(', ', $c->reference_fields ) . "\n\n";
+ join(', ', map {"L</$_>"} $c->reference_fields ) .
+ "\n\n";
}
if ( my $update = $c->on_update ) {
}
}
- $pod .= "=head1 PRODUCED BY\n\n" . header_comment('', ''). "=cut";
+ my $header = ( map { $_ || () } split( /\n/, header_comment('', '') ) )[0];
+ $header =~ s/^Created by //;
+ $pod .= "=head1 PRODUCED BY\n\n$header\n\n=cut";
+
return $pod;
}
=head1 DESCRIPTION
Creates a POD description of each table, field, index, and constraint.
-A good starting point for text documentation of a schema.
+A good starting point for text documentation of a schema. You can
+easily convert the output to HTML or text using "perldoc" or other
+interesting formats using Pod::POM or Template::Toolkit.
=head1 AUTHOR
=head1 SEE ALSO
-perldoc perlpod.
+perldoc, perlpod, Pod::POM, Template::Toolkit.
=cut