Plugin: monthcalendar
Author: Grésille
Test page: test

This plugin provides a monthcalendar directive. The directive displays a month calendar, each day containing links to pages published on this day.

Example

[[!monthcalendar  type="month" year="2012" month="06" pages="events/*"]]

Usage

These options can be set in the directive, or in IkiWiki setup file.

  • type - Used to specify the type of calendar wanted. Right now, "month" is the only accepted value (and is the default). This option is set to remain close to the ?calendar directive, and to anticipate later development.
  • archivebase - Configure the base of the archives hierarchy. Pages are supposed to be of the form archivebase/YEAR/MONTH.mdwn (this is automatically done by ikiwiki-calendar).
  • archive_pagespec - PageSpec of pages to include in the archives; used by ikiwiki-calendar command.
  • week_start_day - First day of the week (0 is Sunday).

Setup

The ikiwiki-calendar command can be used to automatically generate the archive pages. This command is typically run at midnight from cron.

An example crontab:

0 0 * * * ikiwiki-calendar ~/ikiwiki.setup "posts/* and !*/Discussion"

CSS

The output is liberally sprinkled with classes, for fine grained CSS customization.

  • monthcalendar - The month calendar as a whole.
  • monthcalendar-head - The head of the calendar (ie, "March 2012").
  • monthcalendar-arrow - Arrow pointing to previous or next month or year.
  • monthcalendar-day-head - Head of each column ("Monday", "Tuesday", etc.).
  • monthcalendar-day-noday - Day belonging to previous or next month.
  • monthcalendar-day-link - Day containing some links.
  • monthcalendar-day-nolink - Day not containing any link.
  • monthcalendar-day-this-day - Today.
  • monthcalendar-daynumber - Day number.
  • monthcalendar-item - Inlined pages linked in the calendar.
  • Sunday, Monday, Tuesday, ... - Each day square is also given a class matching its (localised) day of week, this can be used to highlight weekends.