Templa...Simple(3pm)

πŸ“¦
version 1.04 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ‘‘ Template::Plugin::Calendar::Simple β€” a Perl module, bestie

okay so picture this: it's a <pink>Template Toolkit</pink> template, right, and you need a calendar. Not a vibe. Not a concept. An actual grid of days. That's literally what this is β€” Template::Plugin::Calendar::Simple, aka "just another HTML calendar generator" (the module's own words, iconic humility, we love her).

She lives in the User Contributed Perl Documentation corner of your 3pm man pages. Let's go πŸ’…


✨ NAME ✨

Template::Plugin::Calendar::Simple β€” just another HTML calendar generator. No cap. That's the whole pitch and honestly? It ate.


🌸 SYNOPSIS 🌸

[% USE cal = Calendar.Simple %]

<table border="1">
  <tr>
  [% FOREACH day = cal.days %]
    <th>[% day %]</th>
  [% END %]
  </tr>
  [% FOREACH row = cal.rows %]
  <tr>
  [% FOREACH col = row %]
    <td>[% col || '&nbsp;' %]</td>
  [% END %]
  </tr>
[% END %]
</table>

see how chill that is?? she gives you the data, you bring the HTML. it's giving collaborative. it's giving teamwork. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So basically: this module hands you calendar delimiters for a Template Toolkit template, by way of Calendar::Simple. This module supplies the data, you supply the HTML. That's the deal, and it's a good deal.

By default she defaults to the current month within the current year β€” very "live in the moment" of her. But listen, past months and years can absolutely be specified, right there in the Template constructor:

[% USE cal = Calendar.Simple( 5, 2000 ) %]

And if you're a Monday girlie and you want your calendars to start with Monday instead of Sunday? Say less:

[% USE cal = Calendar.Simple( 5, 2000, 1 ) %]
...
  [% FOREACH day = cal.days( 1 ) %]
...
fr fr, see the unit tests for more examples. she said "go read the tests, they're basically lore." 😭

πŸ’– METHODS πŸ’–

new()

Constructor. Will be called for you by the Template Toolkit engine. so like, don't stress, she's got you, you literally don't have to do anything here bestie πŸ’…

rows()

[% FOREACH row = cal.rows %]

Returns a Template::Iterator which contains the calendar rows. Each row, however, is simply an array. (yes, nested. rows of arrays. it's a whole layered situation, we love a structured queen.)

days()

[% FOREACH day = cal.days %]

Most calendars have a header with the days β€” this method returns an array of abbreviated day names (currently only in English, sorry international besties, she's monolingual for now 🌈). And if any argument is passed, then the week day starts with Monday instead of Sunday. one lil arg, whole new week order. periodt.


πŸ‘€ SEE ALSO πŸ‘€

  • Template::Plugin
  • Calendar::Simple.

πŸ’€ BUGS AND LIMITATIONS πŸ’€

Found a bug? Got a feature request? Please report it to either:

And here's the cute part: I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. it's giving mutual update pact. it's giving we're in this together. πŸŽ€


🧚 GITHUB 🧚

The Github project is <https://github.com/jeffa/Template-Plugin-Calendar-Simple>

go star it, go lurk, go be nosy. iykyk.


🌈 SUPPORT 🌈

You can find documentation for this module with the perldoc command.

perldoc Template::Plugin::Calendar::Simple

You can also look for information at:

like, pick a link, any link. they're all there for you. πŸ’œ


⭐ AUTHOR ⭐

Jeff Anderson, <jeffa at cpan.org>


Copyright 2024 Jeff Anderson.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

<http://www.perlfoundation.org/artistic_license_2_0>

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ⚠️

and that's the whole page, bestie!! this lil gem is documented under perl v5.38.2 and dated 2024-02-04. take care of her, build cute calendars, and go drink some water. mwah πŸ’‹βœ¨