]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/calendar.mdwn
web commit by tschwinge: But not visible here, but in the Hurd wiki.
[ikiwiki.git] / doc / plugins / calendar.mdwn
1 [[template id=plugin name=calendar author="[[ManojSrivastava]]"]]
2 [[tag type/chrome]]
3
4 This plugin displays a calendar, similar to the typical calendars shown on
5 some blogs.
6
7 # examples
8
9         \[[calendar ]]
10
11         \[[calendar type="month" pages="blog/* and !*/Discussion"]]
12
13         \[[calendar type="year" year="2005" pages="blog/* and !*/Discussion"]]
14
15 This plugin is inspired by the calendar plugin for Blosxom, but
16 derives no code from it. This plugin is essentially a fancy front end
17 to archives of previous pages, usually used for blogs. It can produce
18 a calendar for a given month, or a list of months for a given year.
19
20 The tricky part of this is that while calendar defaults to showing the
21 current day and month, ikiwiki is a wiki compiler, which only rebuilds
22 pages if they have changed. So to keep the calendar up-to-date, wikis that
23 include it need to be periodically rebuilt, typically by cron at midnight.
24
25 The month format calendar simply links to any page posted on each
26 day of the month. The year format calendar links to archive pages, with
27 names like `archives/2007` (for all of 2007)  and `archives/2007/01`
28 (for January, 2007). For this to work, you'll need to create these archive
29 pages. They typically use [[inline]] to display or list pages created in
30 the given time frame.
31
32 ## usage
33
34 * `type` - Used to specify the type of calendar wanted. Can be one of
35   "month" or "year". The default is a month view calendar.
36 * `pages` - Specifies the [[PageSpec]] of pages to link to from the
37   month calendar. Defaults to "*".
38 * `archivebase` - Configures the base of the archives hierarchy. The
39   default is "archives". Note that this default can also be overridden
40   for the whole wiki by setting `archivebase` in ikiwiki's setup file.
41 * `year` - The year for which the calendar is requested. Defaults to the
42   current year.
43 * `month` - The numeric month for which the calendar is requested, in the
44   range 1..12. Used only for the month view calendar, and defaults to the
45   current month.
46 * `week_start_day` - A number, in the range 0..6, which represents the day
47   of the week that the month calendar starts with. 0 is Sunday, 1 is Monday,
48   and so on. Defaults to 0, which is Sunday.
49 * `months_per_row` - In the annual calendar, number of months to place in
50   each row. Defaults to 3.
51
52 ## CSS
53
54 The output is liberally sprinkled with classes, for fine grained CSS
55 customization.
56
57 * `month-calendar` - The month calendar as a whole.
58 * `month-calendar-head` - The head of the month calendar (ie,"March").
59 * `month-calendar-day-head` - A column head in the month calendar (ie, a
60   day-of-week abbreviation).
61 * `month-calendar-day-noday`, `month-calendar-day-link`, 
62   `month-calendar-day-nolink`, `month-calendar-day-future`,
63   `month-calendar-day-this-day` - The day squares on the month calendar,
64   for days that are not in the month (before or after the month itself), that
65   don't have links, that do have links, that are in the future, or are that
66   are the current day, respectively.
67 * `Sunday`, `Monday`, `Tuesday`, ... - Each day square is also given a class
68   matching its  (localised) day of week, this can be used to highlight
69   weekends.
70 * `year-calendar` - The year calendar as a whole.
71 * `year-calendar-head` - The head of the year calendar (ie, "2007").
72 * `year-calendar-subhead` - For example, "Months".
73 * `year-calendar-month-link`, `year-calendar-month-nolink`,
74   `year-calendar-month-future`, `year-calendar-this-month` - The month
75   squares on the year calendar, for months with stories,
76   without, in the future, and currently selected, respectively.