Debian-Package-HTML

 view release on metacpan or  search on metacpan

lib/Debian/Package/HTML.pm  view on Meta::CPAN

1;

# Documentation

=head1 Debian::Package::HTML

Debian::Package::HTML - Generates a webpage information (and Linda/Lintian checks) about a Debian binary or source package using HTML::Template

=head1 SYNOPSIS

  use strict;
  use Debian::Package::HTML;
  my $package = Debian::Package::HTML->new(%packageHash);
  $package->output(%contextHash);

=head1 REQUIRES

HTML::Template

=head1 EXPORTS

Nothing

=head1 DESCRIPTION

This module outputs a webpage using HTML::Template templates which
resumes the information of a normal build environment for a package
in Debian (source files, binary packages and changelogs) using 
Linda/Lintian for sanity checks. It is useful for making unified presentation
webpages for those packages which are being sponsorized by someone in Debian.

=head1 METHODS

=head2 Constructor

=over 4

=item * $object->new(%packageHash)

Constructs an $object with all information concerning the 
package, including location for binary/source files, changelogs, 
diffs, pristine sources, as well as templates, charsets and other
settings.

Possible elements for the hash are:

"binary", "control", "source", "diff", "changes", each one of 
them specifying one of the five possible files generated by a 
package building process in Debian.

"control" is mandatory.

=back

=head2 Output

=over 4

=item * $object->output(%contextHash)

Does the actual XHTML output. Possible elements for the hash are:

"briefing" (boolean): if TRUE, WebInfo will look for a briefing.html 
in the current directory, and will include the content in the resulting 
output. Useful for introducing commentaries without touching the final 
HTML. Defaults to FALSE.

"charset": determines the output charset. Defaults to "ISO-8859-1".

"resultTemplate": specifies the location of an HTML::Template style 
template for output. This is mandatory, and defaults to "result.tmpl"

"pageStyle": specifies the location of a CSS file which might be
included.

"doChecks" (boolean): if TRUE, WebInfo will run linda and lintian over 
the control file and will generate a ${packageName}-checks.txt file which 
will be included in the final output. Defaults to FALSE.

"dump": determines where to put the resulting HTML output. Defaults to
index.html

=head1 DIAGNOSTICS

=head2 No DSC could be found/open

You need to specify a DSC control file using the "control" parameter for the
new() method. If you don't, WebInfo can't do much. The package will inform if 
the file could not be FOUND or could not be OPEN.

Please report the bugs, I'd love to work on them.

=head1 CUSTOMIZATION

=head2 Template customization

You can customize the final output using your own HTML::Template template
file and specifying it as a parameter for the output() method. The following 
template variable names are honored by WebInfo:

packageName: the name of the package

packageVersion: the version of the package

maintainerName: the name of the maintainer

maintainerMail: the e-mail address of the maintainer

maintainerPlus: a "+" separated name/surname for the maintainer (useful for 
URL searching)

pageCharset: the page charset (customizable in the output() method)

pageStyle: the CSS file (customizable in the output() method)

packagef: the available package files as an array reference, so HTML::Template 
should iterate over the "packagefile" variable.

date: the date specified by the current locale

doChecks: a boolean variable specifying if Linda/Lintian checks were made



( run in 0.793 second using v1.01-cache-2.11-cpan-3782747c604 )