The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

hcgen - generate simple HTML month calendar

SYNOPSIS

hcgen [options] [dir]

 Options:
   --output=XXX         output file (see below)
   --reverse            output months in reverse order
   --[no]title          do [not] provide a title (see below)
   --format=XXX         title format
   --prefix=XXX         link prefix (see below)
   --ident              show identification
   --help               brief help message
   --man                full documentation
   --verbose            verbose information

OPTIONS

--output=XXX

Write the generated calendars to this file. If the file exists, and contains the same calendar, it will not be modified so it is useful as a make target.

--reverse

Generate the calendars in reverse order, e.g., newest month first.

--title --notitle

Request titles above the generated calendars. With --title, titles are always provided. With --notitle, titles are never provided. Default is to only provide titles when more than one calendar is generated.

--format=XXX

The format for the titles. It may contain the following substitutions:

  %m       the name of the month, e.g., april
  %M       same, titlecased, e.g., April
  %y  %Y   the year, e.g., 2009

If the format does not start with a < character, it will be output as a HTML <p> element:

  <p class='hc_title'>...</p>

Default format is "%M %Y".

--prefix=XXX

A prefix to add to the generated day links.

--force=YYYYMM

Force the generation of a calendar for this year/month, even if there are no files.

--filter=YYYYMM

Process only files for the given year/month.

This option may occur multiple times.

--help

Print a brief help message and exits.

--man

Prints the manual page and exits.

--ident

Prints program identification.

--verbose

More verbose information.

dir

The directory to process. This directory must contain files (HTML documents) with names formatted as YYYYMMDD.html.

Default is to process the current directory.

DESCRIPTION

hcgen will read the given directory and build a list of all files that obey the name format YYYYMMDD.html. This list will determine the years and months for which calendars must be generated.

Each calendar consists of a table of 7 colums. The first row contains short day names. The other cells contain the date numbers, possibly with a link to a corresponding HTML document.

CSS CLASSES

The table can be completely formatted with CSS style sheets. The CSS classes are shown in the following output excerpt.

  <div class='hc'>
  <p class='hc_title'>February 2009</p>
  <table class='hc_month'>
    <th>Sun</th>
    ....
    <th>Sat</th>
    <tr>
      <td class='hc_empty'></td>
      ...
      <td class='hc_empty'></td>
      <td class='hc_date'>1</td>
    </tr>
    ...
    <tr>
      <td class='hc_date_linked'><a href='20090202.html'>2</a></td>
      ...
    </tr>
    <tr>
      ...
      <td class='hc_date_linked'><a href='20090228.html'>28</a></td>
      <td class='hc_empty'></td>
    </tr>
  </table>
  </div>

If more tables are generated, each one gets its own <div>.

EXAMPLES

  hcgen --output=htdocs/cal.html htdocs

  hcgen --force 200902

Example style sheet:

  p.hc_title {
    font-weight: bold;
  }
  table.hc_month {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 14pt;
    border-collapse: collapse;
    border: 1px solid black;
  }
  .hc_month th {
    font-size: 14pt;
    text-align: center;
    border: 1px solid black;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .hc_month td {
    font-size: 14pt;
    border: 1px solid black;
    text-align: center;
    width: 3em;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .hc_month a {
    text-decoration: none;
    font-weight: bold;
  }
  .hc_empty {
    background: #e0e0e0;
  }

BUGS

The program and its associated module, HTML::Calendar::Monthly are currently hard-wired to generate dutch calendars.

SEE ALSO

HTML::Calendar::Monthly

AUTHOR

Johan Vromans <jvromans@squirrel.nl>