SVG::Calendar - Creates calendars in SVG format which can be printed
This documentation refers to SVG::Calendar version 0.1.
use SVG::Calendar; # Brief but working code example(s) here showing the most common usage(s) # This section will be as far as many users bother reading, so make it as # educational and exemplary as possible. # Create a new (basic) SVG::Calendar object for producing A4 calendars my $svg = SVG::Calendar->new( page => 'A4' ); # print to standard out the calendar for June 2006 print $svg->output_month( '2006-06' ); # create a calendar for the year 2007 $svg->output_year( );
This module generates an SVG image for one or more months for a calendar.
new ( %args )
Arg: page - hash ref - description
page
Arg: moon - hash ref - description
moon
Arg: image - hash ref - description
image
Arg: path - string - Directory containing alternate svg template version
path
Return: SVG::Calendar - A new SVG::Calendar object
Description: Creates and sets up a new SVG::Calendar object
init ( )
Initialises the calendar object
get_page ( )
Return: -
Description:
output_year ( ($start, $end | $year), $file )
Param: $start - string ('YYYY-MM') - description
$start
Param: $end - string ('YYYY-MM') - description
$end
Param: $year - int (year) - description
$year
Param: $file - string - The base name for the SVG files calendars for each year
$file
Return: list - A list of the files created
Description: Creates the SVG calendar files for each month of the year (or for each month from start and end)
eg $svg->output_year( 2006, 'folowers' ); Will result in the following files created flowers-2006-01.svg flowers-2006-02.svg .. flowers-2006-11.svg flowers-2006-12.svg
output_month ( $month, $file, )
Param: $month - string (detail) - The month that the calendar page should display (format YYYY-MM)
$month
Param: $file - string (detail) - The file to save the output to if defined. if $file eq '-' prints to STDOUT
Return: string - The SVG text to display the calendar page
Description: Outputs a particular months calendar...
(Adds the week of the year and the
output ( $file )
Param: $file - string (detail) - The file name to print the SVG file to (if undefined it will print nothing)
Return: scalar - The SVG text.
<path style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.25000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000" d="M 264.88031,225.97672 C 518.24408,341.14207 267.18361,490.85702 267.18361,490.85702 L 264.88031,225.97672 z " id="path1460" sodipodi:nodetypes="ccc" /> <path style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.25000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000" d="M 628.80282,189.12380 C 854.52691,299.68254 847.54045,393.30582 626.49951,477.03718 C 579.56639,494.81567 769.30455,334.23215 628.80282,189.12380 z " id="path1464" sodipodi:nodetypes="csc" /> <path style="fill: green; fill-opacity: 0.25; stroke: black;" d="M 0 0 C 133.3333 8, 133.3333 192, 0 200 C -133.333 192 -133.3333 8 Z" M 0 0 C 133.3333 8 133.3333 192, 0 200 C -133.333 192 -133.3333 8 Z id="test" /> <circle style="fill: none; stroke: red; stroke-opacity: 0.5" cx="0" cy="100" r="100" id="circle" />
moon ( $var1, $var2, )
Param: $phase - float - 0 <= $phase < 2 * pi, represents the phase of the moon
$phase
Param: $id - string (detail) - description
$id
get_moon_phase ( $date )
Param: $date - date (Class::Date object or string to convert to one) - The date that the moon phase is desired
$date
Return: float - The phase of the moon from 0 (new moon) via 2 (full moon) to < 4 (next new moon)
Description: This method calculates the phase of the moon (it will what ever it can find to calculate the phase)
A list of every error and warning message that the module can generate (even the ones that will "never happen"), with a full explanation of each problem, one or more likely causes, and any suggested remedies.
A full explanation of any configuration system(s) used by the module, including the names and locations of any configuration files, and the meaning of any environment variables or properties that can be set. These descriptions must also include details of any configuration language used.
A list of all of the other modules that this module relies upon, including any restrictions on versions, and an indication of whether these required modules are part of the standard Perl distribution, part of the module's distribution, or must be installed separately.
A list of any modules that this module cannot be used in conjunction with. This may be due to name conflicts in the interface, or competition for system or program resources, or due to internal limitations of Perl (for example, many modules that use source code filters are mutually incompatible).
A list of known problems with the module, together with some indication of whether they are likely to be fixed in an upcoming release.
Also, a list of restrictions on the features the module does provide: data types that cannot be handled, performance issues and the circumstances in which they may arise, practical limitations on the size of data sets, special cases that are not (yet) handled, etc.
The initial template usually just has:
There are no known bugs in this module.
Please report problems to Ivan Wills (ivan.wills@gmail.com).
Patches are welcome.
Ivan Wills - (ivan.wills@gmail.com) <Author name(s)> (<contact address>)
Copyright (c) 2006 Ivan Wills (101 Miles St Bald Hills QLD Australia 4036). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install SVG::Calendar, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SVG::Calendar
CPAN shell
perl -MCPAN -e shell install SVG::Calendar
For more information on module installation, please visit the detailed CPAN module installation guide.