]>
Commit | Line | Data |
---|---|---|
b1b509f4 MG |
1 | #!/usr/bin/perl |
2 | use v5.14; | |
3 | use warnings; | |
4 | ||
5 | use Getopt::Long; | |
6 | use SVG::SpriteMaker; | |
7 | ||
8 | my $prefix = 'sprite'; | |
9 | my $out; | |
10 | ||
11 | GetOptions( | |
12 | 'prefix|p=s' => \$prefix, | |
13 | 'output|out|o=s' => \$out, | |
14 | ); | |
15 | ||
16 | my $sprite = make_sprite $prefix, @ARGV; | |
17 | if ($out) { | |
18 | open my $fh, '>', $out; | |
19 | select $fh; | |
20 | } | |
21 | say $sprite->xmlify; | |
22 | ||
23 | __END__ | |
24 | ||
25 | =encoding utf-8 | |
26 | ||
27 | =head1 NAME | |
28 | ||
29 | svg-spritemaker - Combine several SVG images into a single SVG sprite | |
30 | ||
31 | =head1 SYNOPSIS | |
32 | ||
33 | svg-spritemaker [-o OUTPUT] [-p PREFIX] FILE... | |
34 | ||
35 | svg-spritemaker a.svg b.svg > sprite.svg # Standard usage | |
36 | svg-spritemaker -p img a.svg b.svg > sprite.svg # Custom prefix | |
37 | svg-spritemaker -o sprite.svg dir/*.svg # Output file | |
38 | svg-spritemaker --prefix=logo --output=logos.svg logos/* # Long options | |
39 | ||
40 | =head1 DESCRIPTION | |
41 | ||
42 | svg-spritemaker takes several SVG images and combines them into a | |
43 | single SVG sprite. See L<SVG::SpriteMaker> for more information about | |
44 | SVG sprites. | |
45 | ||
46 | =head1 OPTIONS | |
47 | ||
48 | =over | |
49 | ||
50 | =item B<-o> I<file>, B<--out>=I<file>, B<--output>=I<file> | |
51 | ||
52 | Write the sprite into the following file, overwriting it if necessary. | |
53 | By default the sprite is written on STDOUT. | |
54 | ||
55 | =item B<-p> I<prefix>, B<--prefix>=I<prefix> | |
56 | ||
57 | Sets the prefix for the fragment identifiers. Default is C<sprite> | |
58 | (which results in identifiers C<sprite-a>, C<sprite-b> for the first | |
59 | example in the SYNOPSIS). | |
60 | ||
61 | =back | |
62 | ||
63 | =head1 SEE ALSO | |
64 | ||
65 | L<SVG::SpriteMaker>, L<https://css-tricks.com/svg-fragment-identifiers-work/> | |
66 | ||
67 | =head1 AUTHOR | |
68 | ||
69 | Marius Gavrilescu, E<lt>marius@ieval.roE<gt> | |
70 | ||
71 | =head1 COPYRIGHT AND LICENSE | |
72 | ||
73 | Copyright (C) 2015 by Marius Gavrilescu | |
74 | ||
75 | This library is free software; you can redistribute it and/or modify | |
76 | it under the same terms as Perl itself, either Perl version 5.20.2 or, | |
77 | at your option, any later version of Perl 5 you may have available. | |
78 | ||
79 | ||
80 | =cut |