Bump version and update Changes
[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
014f8c27
MG
63If an ID is shared between two or more input files, this program will
64try to rename each occurence except for the first one. This operation
65might have false positives (attributes/cdatas that are mistakenly
66identified to contain the ID-to-be-renamed) and false negatives
67(attributes/cdatas that actually contain the ID-to-be-renamed but this
68is missed by the module), and as such svg-spritemaker will warn if
69duplicate IDs are detected. You can suppress this warning by setting
70the C<SVG_SPRITEMAKER_NO_DUPLICATE_WARNINGS> environment variable to a
71true value.
72
b1b509f4
MG
73=head1 SEE ALSO
74
75L<SVG::SpriteMaker>, L<https://css-tricks.com/svg-fragment-identifiers-work/>
76
77=head1 AUTHOR
78
79Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
80
81=head1 COPYRIGHT AND LICENSE
82
5c7da44c 83Copyright (C) 2015-2017 by Marius Gavrilescu
b1b509f4
MG
84
85This library is free software; you can redistribute it and/or modify
86it under the same terms as Perl itself, either Perl version 5.20.2 or,
87at your option, any later version of Perl 5 you may have available.
88
89
90=cut
This page took 0.013903 seconds and 4 git commands to generate.