package Pod::ProjectDocs::IndexPage; use strict; use warnings; use base qw/Pod::ProjectDocs::File/; use Pod::ProjectDocs::Template; __PACKAGE__->default_name('index.html'); __PACKAGE__->data( do{ local $/; } ); __PACKAGE__->mk_accessors(qw/json components/); sub _init { my($self, %args) = @_; $self->SUPER::_init(%args); $self->json( $args{json} ); $self->components( $args{components} ); } sub _get_data { my $self = shift; my $params = { title => $self->config->title, desc => $self->config->desc, lang => $self->config->lang, json => $self->json, css => $self->components->{css}->tag($self), charset => $self->config->charset || 'UTF-8', }; my $tt = Pod::ProjectDocs::Template->new; my $text = $tt->process($self, $self->data, $params); return $text; } 1; __DATA__ [% title | html %] [% css %]

[% title | html %]

Description [% desc | html_line_break %]

Search

[% FOREACH manager IN managers %] [% IF manager.docs.size %]

[% manager.desc | html %]

[% seq = 1 %] [% FOREACH doc IN manager.docs %] [% seq = seq + 1 %] [% END %]
[% doc.name | html %] [% doc.title | html %]
[% END %] [% END %]