]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/contrib/trail.mdwn
5adff4c78b29f45c29409c3e18b0ea5c28d47afa
[ikiwiki.git] / doc / plugins / contrib / trail.mdwn
1 [[!tag patch]]
2 [[!template id=gitbranch branch=smcv/trail author="[[smcv]]"]]
3
4 Available from [[smcv]]'s git repository, in the `trail` branch. This
5 plugin aims to solve [[todo/wikitrails]] in a simpler way; it can also be
6 used for [[navigation through blog posts|todo/Pagination_next_prev_links]].
7
8 The branch also includes [[todo/test_coverage]] machinery.
9
10 Demo:
11
12 * [a trail based on links](http://demo.hosted.pseudorandom.co.uk/trail/)
13 * [a hybrid trail/inline](http://demo.hosted.pseudorandom.co.uk/trail2/)
14
15 The page `e` in the demo is in both trails, to demonstrate how that looks.
16
17 The `smcv/trail2` branch is an older version of `trail` which used typed links
18 as its data structure, resulting in timing-related limitations (it couldn't
19 select pages for the trail by using pagespecs, because pagespecs can't be
20 evaluated correctly until the scan stage has finished).
21
22 Updated, November 2011:
23
24 * reinstated `inline` integration ([[report]] integration would probably be
25   pretty easy too, if this gets merged)
26
27 * switched from typed links back to a custom data structure to avoid
28   chicken/egg problems with ordering
29
30 * create typed links too, as a side-effect, but not when using an inline
31
32 * regression test with nearly full coverage
33
34 * CSS for the default anti-theme and all built-in themes (it looks nicest
35   in the default anti-theme and in actiontabs - the demo uses actiontabs)
36
37 Known bugs:
38
39 * the blueview and goldtype CSS nearly work, but the alignment is a bit off
40
41 ----
42
43 [[!template id=plugin name=trail author="[[Simon_McVittie|smcv]]"]]
44 [[!tag type/chrome]]
45
46 This plugin provides the [[ikiwiki/directive/trail]],
47 [[ikiwiki/directive/traillink]], [[ikiwiki/directive/trailitem]],
48 and [[ikiwiki/directive/trailinline]] [[directives|ikiwiki/directive]].
49
50 It's sometimes useful to have "trails" of pages in a wiki where each
51 page links to the next and/or previous page. For instance, you could use
52 this for a guided tour, sequence of chapters, or sequence of blog posts.
53
54 In this plugin, a trail is represented by a page, and the pages in the
55 trail are indicated by specially marked links within that page, or by
56 including groups of pages with a [[ikiwiki/directive]].
57
58 If using the default `page.tmpl`, each page automatically displays the
59 trails that it's a member of (if any), with links to the trail and to
60 the next and previous members. HTML `<link>` tags with the `prev`,
61 `next` and `up` relations are also generated.
62
63 Pages can be included in a trail in various ways:
64
65 * The [[ikiwiki/directive/trailinline]] directive sets up an [[inline]],
66   and at the same time adds the matching pages (from `pages` or `pagenames`)
67   to the trail. One use is to navigate through all posts in a blog:
68
69         \[[!trailinline pages="page(./posts/*) and !*/Discussion" archive=yes
70           feedshow=10 quick=yes]]
71
72   This directive only works if the [[!iki plugins/inline desc=inline]]
73   plugin is also enabled.
74
75 * The [[ikiwiki/directive/trail]] directive has optional `pages` and
76   `pagenames` options which behave the same as in [[inline]], but don't
77   produce any output in the page, so you can have trails that don't list
78   all their pages.
79
80 * The [[ikiwiki/directive/traillink]] directive makes a visible link
81   and also adds the linked page to the trail. This will typically be
82   used in a bullet list, but could also be in paragraph text:
83
84         * [[!traillink Introduction]]
85         * [[!traillink "Chapter 1"]]
86         * [[!traillink Chapter_2]]
87         * [[!traillink Appendix_A]]
88
89   or
90
91         To use this software you must \[[!traillink install]] it,
92         \[[!traillink configuration text="configure it"]],
93         and finally \[[!traillink running|run_it]].
94
95   This also counts as a [[ikiwiki/WikiLink]] for things like the `link()`
96   [[ikiwiki/PageSpec]] item.
97
98 * The [[ikiwiki/directive/trailitem]] directive adds a page to the trail
99   like `traillink`, but produces an invisible link, rather like `\[[!tag]]`:
100
101         To use this software you must \[[!traillink install]] it,
102         \[[!trailitem installing_from_packages]]
103         \[[!trailitem installing_from_source]]
104         \[[!traillink configuration text="configure it"]],
105         and finally \[[!traillink running|run_it]].
106         \[[!trailitem troubleshooting]]
107
108   Like `\[[!tag]]`, this still counts as a [[ikiwiki/WikiLink]] even though
109   there's no visible link.
110
111 You can mix several of these directives in one page, and the resulting
112 trail will contain all of the pages matched by any of the directives,
113 in the same order as the directives (unless you use the `sort` option
114 on `\[[!trail]]` or `\[[!trailinline]]`, which takes precedence).
115
116 The [[ikiwiki/directive/trail]] directive can also be used to set options.