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