1 [[!tag type/chrome patch]]
2 [[!template id=gitbranch branch=smcv/trail author="[[smcv]]"]]
4 Available from [[smcv]]'s git repository, in the `trail` branch. This
5 plugin aims to solve [[todo/wikitrails]] in a simpler way.
9 * removed `inline` integration for now
13 * switched from a custom data structure to using typed links
17 [[!template id=plugin name=trail author="[[Simon_McVittie|smcv]]"]]
19 It's sometimes useful to have "trails" of pages in a wiki, as a guided
20 tour, sequence of chapters etc. In this plugin, a trail is represented
21 by a page, and the pages in the trail are indicated by specially marked
22 links within that page.
24 If using the default `page.tmpl`, each page automatically displays the
25 trails that it's a member of (if any), with links to the trail and to
26 the next and previous members. HTML `<link>` tags with the `prev`,
27 `next` and `up` relations are also generated.
29 The `traillink` [[ikiwiki/directive]] is used to record which pages
30 are in a trail, and simultaneously link to them. Alternatively, the
31 [[ikiwiki/directive/trailitem]] directive can be used to make an
32 invisible `traillink`.
36 (These will go to the appropriate pages in [[ikiwiki/directive]] if this
37 plugin is included in ikiwiki.)
41 The `trailitem` directive is supplied by the [[!iki plugins/contrib/trail desc=trail]]
42 plugin. It is used like this:
44 \[[!trailitem some_other_page]]
46 to add `some_other_page` to the trail represented by this page, without
47 generating a visible hyperlink.
51 The `traillink` directive is supplied by the [[!iki plugins/contrib/trail desc=trail]]
52 plugin. It generates a visible [[ikiwiki/WikiLink]], and also adds the linked page to
53 the trail represented by the page containing the directive.
55 In its simplest form, the first parameter is like the content of a WikiLink:
57 \[[!traillink some_other_page]]
59 The displayed text can also be overridden, either with a `|` symbol or with
62 \[[!traillink Click_here_to_start_the_trail|some_other_page]]
63 \[[!traillink some_other_page text="Click here to start the trail"]]
67 The `trailoptions` directive is supplied by the [[!iki plugins/contrib/trail desc=trail]]
68 plugin. It sets options for the trail represented by this page. Example usage:
70 \[[!trailoptions sort="meta(title)" circular="no"]]
72 The available options are:
74 * `sort`: sets a [[ikiwiki/pagespec/sorting]] order; if not specified, the
75 items of the trail are ordered according to the first link to each item
76 found on the trail page
78 * `circular`: if set to `yes` or `1`, the trail is made into a loop by
79 making the last page's "next" link point to the first page, and the first
80 page's "previous" link point to the last page
86 The current version of this plugin doesn't implement inline-based or
87 otherwise [[ikiwiki/PageSpec]]-based trails. This is difficult because
88 there's a circular dependency:
90 * adding typed links should happen *before* scanning has finished, to
91 guarantee that they're available before the first page is rendered
93 * evaluating pagespecs should only happen *after* scanning has finished,
94 to guarantee that everything you might want to base a pagespec on
95 (`meta`, etc.) has been gathered by scanning