1 [[!template id=plugin name=postsparkline author="[[Joey]]"]]
4 This plugin uses the [[sparkline]] plugin to create a sparkline of
5 statistics about a set of pages, such as posts to a blog.
10 \[[!postsparkline pages="blog/* and !*/Discussion" max=100
11 formula=interval style=bar barwidth=2 barspacing=1 height=13]]
13 Posts per month this year:
14 \[[!postsparkline pages="blog/* and !*/Discussion" max=12
15 formula=permonth style=bar barwidth=2 barspacing=1 height=13]]
19 All options aside fron the `pages`, `max`, `formula`, `time`, and `color`
20 options are passed on to the sparkline plugin.
22 You don't need to specify any data points (though you can if you want to).
23 Instead, data points are automatically generated based on the creation
24 times of pages matched by the specified `pages` [[ikiwiki/PageSpec]]. A
25 maximum of `max` data points will be generated.
27 The `formula` parameter controls the formula used to generate data points.
30 * `interval` - The height of each point represents how long it has been
31 since the previous post.
32 * `perday` - Each point represents a day; the height represents how
33 many posts were made that day.
34 * `permonth` - Each point represents a month; the height represents how
35 many posts were made that month.
36 * `peryear` - Each point represents a day; the height represents how
37 many posts were made that year.
39 The `time` parameter has a default value of "ctime", since forumae use
40 the creation times of pages by default. If you instead want
41 them to use the modification times of pages, set it to "mtime".
43 To change the color used to draw the sparkline, use the `color` parameter.
44 For example, "color=red".
48 Additional formulae can be added without modifying this plugin by writing
49 plugins that register functions in the
50 `IkiWiki::Plugin::postsparkline::formula` namespace. These functions will
51 receive on input a reference to a hash of parameters, and a sorted list of
52 pages, and should return a list of data points for the sparkline plugin.