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`, and `forumla` options are passed
20 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` [[PageSpec]]. A maximum of
25 `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.
41 Additional formulae can be added without modifying this plugin by writing
42 plugins that register functions in the
43 `IkiWiki::Plugin::postsparkline::formula` namespace. These functions will
44 receive on input a reference to a hash of parameters, and a sorted list of
45 pages (newest pages first), and should return a list of data points for