| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::revealup::cli::export::theme; |
|
2
|
2
|
|
|
2
|
|
915
|
use App::revealup::base; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
11
|
|
|
3
|
2
|
|
|
2
|
|
392
|
use App::revealup::util; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
147
|
|
|
4
|
2
|
|
|
2
|
|
14
|
use Path::Tiny qw/path/; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
90
|
|
|
5
|
2
|
|
|
2
|
|
46
|
use Getopt::Long qw/GetOptionsFromArray/; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
12
|
|
|
6
|
2
|
|
|
2
|
|
264
|
use Term::ANSIColor; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
655
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'base' => 'black'; |
|
9
|
|
|
|
|
|
|
has 'output' => 'original.css'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub run { |
|
12
|
2
|
|
|
2
|
0
|
5
|
my ($self, @args) = @_; |
|
13
|
2
|
|
|
|
|
3
|
my $opt; |
|
14
|
|
|
|
|
|
|
my $result = parse_options( |
|
15
|
|
|
|
|
|
|
\@args, |
|
16
|
|
|
|
|
|
|
'output=s' => \$opt->{output}, |
|
17
|
|
|
|
|
|
|
'base=s' => \$opt->{base}, |
|
18
|
2
|
|
|
|
|
10
|
); |
|
19
|
|
|
|
|
|
|
|
|
20
|
2
|
|
|
|
|
8
|
for my $key (keys %$opt) { |
|
21
|
4
|
|
|
|
|
19
|
$self->$key( $opt->{$key} ); |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
8
|
my $filepath = path('.', $self->output); |
|
25
|
2
|
50
|
|
|
|
94
|
if ($filepath->exists) { |
|
26
|
0
|
|
|
|
|
0
|
App::revealup::util::error("$filepath exists"); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
2
|
50
|
|
|
|
35
|
my $base = $self->base !~ m!\.css$! ? $self->base . '.css' : $self->base; |
|
30
|
2
|
|
|
|
|
8
|
my $reveal_theme_path = App::revealup::util::share_path([qw/share revealjs css theme/]); |
|
31
|
2
|
|
|
|
|
51
|
my $base_path = $reveal_theme_path->child($base); |
|
32
|
|
|
|
|
|
|
|
|
33
|
2
|
50
|
|
|
|
71
|
if (!$base_path->exists) { |
|
34
|
0
|
|
|
|
|
0
|
App::revealup::util::error("base theme '$base' does not exist"); |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
39
|
my $content = $base_path->slurp(); |
|
38
|
2
|
|
|
|
|
445
|
$filepath->spew_utf8($content); |
|
39
|
2
|
|
|
|
|
1907
|
App::revealup::util::info("Generated your CSS to @{[$self->output]}"); |
|
|
2
|
|
|
|
|
9
|
|
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |