]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/postsparkline.mdwn
added toc
[ikiwiki.git] / doc / ikiwiki / directive / postsparkline.mdwn
1 The `postsparkline` directive is supplied by the [[!iki plugins/postsparkline desc=postsparkline]] plugin.
2
3 This directive uses the [[!iki plugins/sparkline desc=sparkline]] plugin to create a
4 [[sparkline]] of statistics about a set of pages, such as posts to a blog.
5
6 # examples
7
8         Post interval: 
9         \[[!postsparkline pages="blog/* and !*/Discussion" max=100
10         formula=interval style=bar barwidth=2 barspacing=1 height=13]]
11         
12         Posts per month this year: 
13         \[[!postsparkline pages="blog/* and !*/Discussion" max=12
14         formula=permonth style=bar barwidth=2 barspacing=1 height=13]]
15
16 # usage
17
18 All options aside from the `pages`, `max`, `formula`, `time`, and `color`
19 options are the same as in [[sparkline]] directive.
20
21 You don't need to specify any data points (though you can if you want to).
22 Instead, data points are automatically generated based on the creation
23 times of pages matched by the specified `pages` [[ikiwiki/PageSpec]]. A
24 maximum of `max` data points will be generated.
25
26 The `formula` parameter controls the formula used to generate data points.
27 Available formulae:
28
29 * `interval` - The height of each point represents how long it has been
30   since the previous post.
31 * `perday` - Each point represents a day; the height represents how
32   many posts were made that day.
33 * `permonth` - Each point represents a month; the height represents how
34   many posts were made that month.
35 * `peryear` - Each point represents a year; the height represents how
36   many posts were made that year.
37
38 The `time` parameter has a default value of "ctime", since formulae use
39 the creation times of pages by default. If you instead want
40 them to use the modification times of pages, set it to "mtime".
41
42 To change the color used to draw the sparkline, use the `color` parameter.
43 For example, "color=red".
44
45 [[!meta robots="noindex, follow"]]