2011-11-10 00:43:00 +01:00
|
|
|
[[!tag patch]]
|
2009-07-25 20:55:22 +02:00
|
|
|
[[!template id=gitbranch branch=smcv/trail author="[[smcv]]"]]
|
2009-07-18 19:46:55 +02:00
|
|
|
|
|
|
|
Available from [[smcv]]'s git repository, in the `trail` branch. This
|
2011-11-10 00:43:00 +01:00
|
|
|
plugin aims to solve [[todo/wikitrails]] in a simpler way; it can also be
|
2011-11-10 00:44:05 +01:00
|
|
|
used for [[navigation through blog posts|todo/Pagination_next_prev_links]].
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:49:30 +01:00
|
|
|
The branch also includes [[todo/test_coverage]] machinery.
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
Demo:
|
2009-07-31 23:14:50 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* [a trail based on links](http://demo.hosted.pseudorandom.co.uk/trail/)
|
|
|
|
* [a hybrid trail/inline](http://demo.hosted.pseudorandom.co.uk/trail2/)
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
The page `e` in the demo is in both trails, to demonstrate how that looks.
|
2009-07-31 23:14:50 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
The `smcv/trail2` branch is an older version of `trail` which used typed links
|
|
|
|
as its data structure, resulting in timing-related limitations (it couldn't
|
|
|
|
select pages for the trail by using pagespecs, because pagespecs can't be
|
|
|
|
evaluated correctly until the scan stage has finished).
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
Updated, November 2011:
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* reinstated `inline` integration ([[report]] integration would probably be
|
|
|
|
pretty easy too, if this gets merged)
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* switched from typed links back to a custom data structure to avoid
|
|
|
|
chicken/egg problems with ordering
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* create typed links too, as a side-effect, but not when using an inline
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* regression test with nearly full coverage
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* CSS for the default anti-theme and all built-in themes (it looks nicest
|
|
|
|
in the default anti-theme and in actiontabs - the demo uses actiontabs)
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
Known bugs:
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* the blueview and goldtype CSS nearly work, but the alignment is a bit off
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
----
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
[[!template id=plugin name=trail author="[[Simon_McVittie|smcv]]"]]
|
|
|
|
[[!tag type/chrome]]
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
This plugin provides the [[ikiwiki/directive/trail]],
|
|
|
|
[[ikiwiki/directive/traillink]], [[ikiwiki/directive/trailitem]],
|
|
|
|
and [[ikiwiki/directive/trailinline]] [[directives|ikiwiki/directive]].
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
It's sometimes useful to have "trails" of pages in a wiki where each
|
|
|
|
page links to the next and/or previous page. For instance, you could use
|
|
|
|
this for a guided tour, sequence of chapters, or sequence of blog posts.
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
In this plugin, a trail is represented by a page, and the pages in the
|
|
|
|
trail are indicated by specially marked links within that page, or by
|
|
|
|
including groups of pages with a [[ikiwiki/directive]].
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
If using the default `page.tmpl`, each page automatically displays the
|
|
|
|
trails that it's a member of (if any), with links to the trail and to
|
|
|
|
the next and previous members. HTML `<link>` tags with the `prev`,
|
|
|
|
`next` and `up` relations are also generated.
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
Pages can be included in a trail in various ways:
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* The [[ikiwiki/directive/trailinline]] directive sets up an [[inline]],
|
|
|
|
and at the same time adds the matching pages (from `pages` or `pagenames`)
|
|
|
|
to the trail. One use is to navigate through all posts in a blog:
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
\[[!trailinline pages="page(./posts/*) and !*/Discussion" archive=yes
|
|
|
|
feedshow=10 quick=yes]]
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
This directive only works if the [[!iki plugins/inline desc=inline]]
|
|
|
|
plugin is also enabled.
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* The [[ikiwiki/directive/trail]] directive has optional `pages` and
|
|
|
|
`pagenames` options which behave the same as in [[inline]], but don't
|
|
|
|
produce any output in the page, so you can have trails that don't list
|
|
|
|
all their pages.
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* The [[ikiwiki/directive/traillink]] directive makes a visible link
|
|
|
|
and also adds the linked page to the trail. This will typically be
|
|
|
|
used in a bullet list, but could also be in paragraph text:
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
* [[!traillink Introduction]]
|
|
|
|
* [[!traillink "Chapter 1"]]
|
|
|
|
* [[!traillink Chapter_2]]
|
|
|
|
* [[!traillink Appendix_A]]
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
or
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
To use this software you must \[[!traillink install]] it,
|
|
|
|
\[[!traillink configuration text="configure it"]],
|
|
|
|
and finally \[[!traillink running|run_it]].
|
|
|
|
|
|
|
|
This also counts as a [[ikiwiki/WikiLink]] for things like the `link()`
|
|
|
|
[[ikiwiki/PageSpec]] item.
|
|
|
|
|
|
|
|
* The [[ikiwiki/directive/trailitem]] directive adds a page to the trail
|
|
|
|
like `traillink`, but produces an invisible link, rather like `\[[!tag]]`:
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
To use this software you must \[[!traillink install]] it,
|
|
|
|
\[[!trailitem installing_from_packages]]
|
|
|
|
\[[!trailitem installing_from_source]]
|
|
|
|
\[[!traillink configuration text="configure it"]],
|
|
|
|
and finally \[[!traillink running|run_it]].
|
|
|
|
\[[!trailitem troubleshooting]]
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
Like `\[[!tag]]`, this still counts as a [[ikiwiki/WikiLink]] even though
|
|
|
|
there's no visible link.
|
2011-06-05 19:11:32 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
You can mix several of these directives in one page, and the resulting
|
|
|
|
trail will contain all of the pages matched by any of the directives,
|
|
|
|
in the same order as the directives (unless you use the `sort` option
|
|
|
|
on `\[[!trail]]` or `\[[!trailinline]]`, which takes precedence).
|
2009-07-18 19:46:55 +02:00
|
|
|
|
2011-11-10 00:43:00 +01:00
|
|
|
The [[ikiwiki/directive/trail]] directive can also be used to set options.
|