source: main/trunk/greenstone2/perllib/cpan/Mojolicious/Command/generate.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: 2.1 KB
Line 
1package Mojolicious::Command::generate;
2use Mojo::Base 'Mojolicious::Commands';
3
4has description => 'Generate files and directories from templates';
5has hint => <<EOF;
6
7See 'APPLICATION generate help GENERATOR' for more information on a specific
8generator.
9EOF
10has message => sub { shift->extract_usage . "\nGenerators:\n" };
11has namespaces => sub { ['Mojolicious::Command::generate'] };
12
13sub help { shift->run(@_) }
14
151;
16
17=encoding utf8
18
19=head1 NAME
20
21Mojolicious::Command::generate - Generator command
22
23=head1 SYNOPSIS
24
25 Usage: APPLICATION generate GENERATOR [OPTIONS]
26
27 mojo generate app
28 mojo generate lite_app
29
30=head1 DESCRIPTION
31
32L<Mojolicious::Command::generate> lists available generators.
33
34This is a core command, that means it is always enabled and its code a good
35example for learning to build new commands, you're welcome to fork it.
36
37See L<Mojolicious::Commands/"COMMANDS"> for a list of commands that are
38available by default.
39
40=head1 ATTRIBUTES
41
42L<Mojolicious::Command::generate> inherits all attributes from
43L<Mojolicious::Commands> and implements the following new ones.
44
45=head2 description
46
47 my $description = $generator->description;
48 $generator = $generator->description('Foo');
49
50Short description of this command, used for the command list.
51
52=head2 hint
53
54 my $hint = $generator->hint;
55 $generator = $generator->hint('Foo');
56
57Short hint shown after listing available generator commands.
58
59=head2 message
60
61 my $msg = $generator->message;
62 $generator = $generator->message('Bar');
63
64Short usage message shown before listing available generator commands.
65
66=head2 namespaces
67
68 my $namespaces = $generator->namespaces;
69 $generator = $generator->namespaces(['MyApp::Command::generate']);
70
71Namespaces to search for available generator commands, defaults to
72L<Mojolicious::Command::generate>.
73
74=head1 METHODS
75
76L<Mojolicious::Command::generate> inherits all methods from
77L<Mojolicious::Commands> and implements the following new ones.
78
79=head2 help
80
81 $generator->help('app');
82
83Print usage information for generator command.
84
85=head1 SEE ALSO
86
87L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>.
88
89=cut
Note: See TracBrowser for help on using the repository browser.