source: main/trunk/greenstone2/perllib/cpan/Mojolicious/Plugin.pm@ 32205

Last change on this file since 32205 was 32205, checked in by ak19, 6 years ago

First set of commits to do with implementing the new 'paged_html' output option of PDFPlugin that uses using xpdftools' new pdftohtml. So far tested only on Linux (64 bit), but things work there so I'm optimistically committing the changes since they work. 2. Committing the pre-built Linux binaries of XPDFtools for both 32 and 64 bit built by the XPDF group. 2. To use the correct bitness variant of xpdftools, setup.bash now exports the BITNESS env var, consulted by gsConvert.pl. 3. All the perl code changes to do with using xpdf tools' pdftohtml to generate paged_html and feed it in the desired form into GS(3): gsConvert.pl, PDFPlugin.pm and its parent ConvertBinaryPFile.pm have been modified to make it all work. xpdftools' pdftohtml generates a folder containing an html file and a screenshot for each page in a PDF (as well as an index.html linking to each page's html). However, we want a single html file that contains each individual 'page' html's content in a div, and need to do some further HTML style, attribute and structure modifications to massage the xpdftool output to what we want for GS. In order to parse and manipulate the HTML 'DOM' to do this, we're using the Mojo::DOM package that Dr Bainbridge found and which he's compiled up. Mojo::DOM is therefore also committed in this revision. Some further changes and some display fixes are required, but need to check with the others about that.

File size: 1.0 KB
Line 
1package Mojolicious::Plugin;
2use Mojo::Base -base;
3
4use Carp 'croak';
5
6sub register { croak 'Method "register" not implemented by subclass' }
7
81;
9
10=encoding utf8
11
12=head1 NAME
13
14Mojolicious::Plugin - Plugin base class
15
16=head1 SYNOPSIS
17
18 # CamelCase plugin name
19 package Mojolicious::Plugin::MyPlugin;
20 use Mojo::Base 'Mojolicious::Plugin';
21
22 sub register {
23 my ($self, $app, $conf) = @_;
24
25 # Magic here! :)
26 }
27
28=head1 DESCRIPTION
29
30L<Mojolicious::Plugin> is an abstract base class for L<Mojolicious> plugins.
31
32See L<Mojolicious::Plugins/"PLUGINS"> for a list of plugins that are available
33by default.
34
35=head1 METHODS
36
37L<Mojolicious::Plugin> inherits all methods from L<Mojo::Base> and implements
38the following new ones.
39
40=head2 register
41
42 $plugin->register(Mojolicious->new);
43 $plugin->register(Mojolicious->new, {foo => 'bar'});
44
45This method will be called by L<Mojolicious::Plugins> at startup time. Meant to
46be overloaded in a subclass.
47
48=head1 SEE ALSO
49
50L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>.
51
52=cut
Note: See TracBrowser for help on using the repository browser.