diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/examples/blog/posts.mdwn | 2 | ||||
-rw-r--r-- | doc/ikiwiki/directive/inline.mdwn | 5 | ||||
-rw-r--r-- | doc/ikiwiki/directive/trailitem.mdwn (renamed from doc/plugins/contrib/ikiwiki/directive/trailitem.mdwn) | 2 | ||||
-rw-r--r-- | doc/ikiwiki/directive/trailitems.mdwn (renamed from doc/plugins/contrib/ikiwiki/directive/trailitems.mdwn) | 2 | ||||
-rw-r--r-- | doc/ikiwiki/directive/traillink.mdwn (renamed from doc/plugins/contrib/ikiwiki/directive/traillink.mdwn) | 2 | ||||
-rw-r--r-- | doc/ikiwiki/directive/trailoptions.mdwn (renamed from doc/plugins/contrib/ikiwiki/directive/trailoptions.mdwn) | 2 | ||||
-rw-r--r-- | doc/plugins/contrib/ikiwiki/directive/trailinline.mdwn | 11 | ||||
-rw-r--r-- | doc/plugins/contrib/trail.mdwn | 139 | ||||
-rw-r--r-- | doc/plugins/trail.mdwn | 76 | ||||
-rw-r--r-- | doc/plugins/write.mdwn | 16 | ||||
-rw-r--r-- | doc/style.css | 35 | ||||
-rw-r--r-- | doc/templates.mdwn | 2 |
12 files changed, 139 insertions, 155 deletions
diff --git a/doc/examples/blog/posts.mdwn b/doc/examples/blog/posts.mdwn index 08e014838..2bd0f1d6f 100644 --- a/doc/examples/blog/posts.mdwn +++ b/doc/examples/blog/posts.mdwn @@ -1,3 +1,3 @@ Here is a full list of posts to the [[blog|index]]. -[[!inline pages="page(./posts/*) and !*/Discussion" archive=yes feedshow=10 quick=yes]] +[[!inline pages="page(./posts/*) and !*/Discussion" archive=yes feedshow=10 quick=yes trail=yes]] diff --git a/doc/ikiwiki/directive/inline.mdwn b/doc/ikiwiki/directive/inline.mdwn index 22c18d9a1..4b11e5997 100644 --- a/doc/ikiwiki/directive/inline.mdwn +++ b/doc/ikiwiki/directive/inline.mdwn @@ -117,5 +117,10 @@ Here are some less often needed parameters: [[SubPage/LinkingRules]] as in a [[ikiwiki/WikiLink]]), and they are inlined in exactly the order given: the `sort` and `pages` parameters cannot be used in conjunction with this one. +* `trail` - If the [[!iki plugins/trail desc=trail]] plugin is enabled, turn + the inlined pages into a trail with next/previous links, by passing the same + options to [[ikiwiki/directive/trailitems]]. The `skip` and `show` options + are ignored by the trail, so the next/previous links traverse through + all matching pages. [[!meta robots="noindex, follow"]] diff --git a/doc/plugins/contrib/ikiwiki/directive/trailitem.mdwn b/doc/ikiwiki/directive/trailitem.mdwn index 73b1985a5..59626b5a1 100644 --- a/doc/plugins/contrib/ikiwiki/directive/trailitem.mdwn +++ b/doc/ikiwiki/directive/trailitem.mdwn @@ -1,5 +1,5 @@ The `trailitem` directive is supplied by the -[[!iki plugins/contrib/trail desc=trail]] plugin. It is used like this: +[[!iki plugins/trail desc=trail]] plugin. It is used like this: \[[!trailitem some_other_page]] diff --git a/doc/plugins/contrib/ikiwiki/directive/trailitems.mdwn b/doc/ikiwiki/directive/trailitems.mdwn index 4106ed33b..b1ba8d356 100644 --- a/doc/plugins/contrib/ikiwiki/directive/trailitems.mdwn +++ b/doc/ikiwiki/directive/trailitems.mdwn @@ -1,5 +1,5 @@ The `trailitems` directive is supplied by the -[[!iki plugins/contrib/trail desc=trail]] plugin. It adds pages +[[!iki plugins/trail desc=trail]] plugin. It adds pages to the trail represented by the current page, without producing any output on that page. diff --git a/doc/plugins/contrib/ikiwiki/directive/traillink.mdwn b/doc/ikiwiki/directive/traillink.mdwn index 0e40e2411..090e2538d 100644 --- a/doc/plugins/contrib/ikiwiki/directive/traillink.mdwn +++ b/doc/ikiwiki/directive/traillink.mdwn @@ -1,5 +1,5 @@ The `traillink` directive is supplied by the -[[!iki plugins/contrib/trail desc=trail]] +[[!iki plugins/trail desc=trail]] plugin. It generates a visible [[ikiwiki/WikiLink]], and also adds the linked page to the trail represented by the page containing the directive. diff --git a/doc/plugins/contrib/ikiwiki/directive/trailoptions.mdwn b/doc/ikiwiki/directive/trailoptions.mdwn index e1603f11b..d83f444c0 100644 --- a/doc/plugins/contrib/ikiwiki/directive/trailoptions.mdwn +++ b/doc/ikiwiki/directive/trailoptions.mdwn @@ -1,5 +1,5 @@ The `trailoptions` directive is supplied by the -[[!iki plugins/contrib/trail desc=trail]] plugin. It sets options for the +[[!iki plugins/trail desc=trail]] plugin. It sets options for the trail represented by this page. \[[!trailoptions sort="meta(title)" circular="no"]] diff --git a/doc/plugins/contrib/ikiwiki/directive/trailinline.mdwn b/doc/plugins/contrib/ikiwiki/directive/trailinline.mdwn deleted file mode 100644 index 91d8a4edf..000000000 --- a/doc/plugins/contrib/ikiwiki/directive/trailinline.mdwn +++ /dev/null @@ -1,11 +0,0 @@ -The `trailinline` directive is provided by the -[[!iki plugins/contrib/trail desc=trail]] -plugin. It is equivalent to combining [[ikiwiki/directive/trailitems]] and -[[ikiwiki/directive/inline]] directives with the same options. - -A typical use is to navigate through all posts in a blog: - - \[[!trailinline pages="page(./posts/*) and !*/Discussion" archive=yes - feedshow=10 quick=yes]] - -[[!meta robots="noindex, follow"]] diff --git a/doc/plugins/contrib/trail.mdwn b/doc/plugins/contrib/trail.mdwn deleted file mode 100644 index 9d895783a..000000000 --- a/doc/plugins/contrib/trail.mdwn +++ /dev/null @@ -1,139 +0,0 @@ -[[!tag patch]] -[[!template id=gitbranch branch=smcv/trail3-integrated author="[[smcv]]"]] - -Available from [[smcv]]'s git repository, in the `trail3` and `trail3-integrated` branches. This -plugin aims to solve [[todo/wikitrails]] in a simpler way; it can also be -used for [[navigation through blog posts|todo/Pagination_next_prev_links]]. - -If you don't want to use a branch of ikiwiki, manual installation requires -these files (use the "raw" link in gitweb to download): - -* [trail.pm](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/trail3:/IkiWiki/Plugin/trail.pm) - in an `IkiWiki/Plugin` subdirectory of your configured `plugindir` -* [page.tmpl](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/trail3:/templates/page.tmpl) - and - [trails.tmpl](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/trail3:/templates/trails.tmpl) - in your configured `templatedir`, or a `templates` subdirectory of your wiki repository -* the trail-related bits from the end of the - [stylesheet](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/trail3:/doc/style.css) - (put them in your local.css) -* the trail-related bits at the end of the - [actiontabs](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/trail3:/themes/actiontabs/style.css) - or [blueview/goldtype](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/trail3:/themes/blueview/style.css) - stylesheets, if you use one of those themes (again, put them in your local.css) - -The branch also includes [[todo/test_coverage]] machinery. - -Demo: - -* [in use on entries in my blog](http://smcv.pseudorandom.co.uk/) -* [a demo trail based on links](http://demo.hosted.pseudorandom.co.uk/trail/) -* [a demo hybrid trail/inline](http://demo.hosted.pseudorandom.co.uk/trail2/) - -The page `e` is in both demo trails, to demonstrate how a page in more than -one trail looks. - -The `smcv/trail2` branch is an older version of `trail3` 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). - -Updated, November 2011 (`trail3`): - -* reinstated `inline` integration ([[report]] integration would probably be - pretty easy too, if this gets merged) -* switched from typed links back to a custom data structure to avoid - chicken/egg problems with ordering -* create typed links too, as a side-effect, but not when using an inline -* regression test with nearly full coverage -* 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) - -Updated, March 2012 (`trail3-integrated`): - -* replaced `\[[!trailinline]]` with `\[[!inline trail=yes]]` -* added a `build_affected` hook so it doesn't have to use `inject` - (optional commit, can be omitted) - -Known bugs: - -* the blueview and goldtype CSS nearly work, but the alignment is a bit off - ----- - -[[!template id=plugin name=trail author="[[Simon_McVittie|smcv]]"]] -[[!tag type/chrome]] - -This plugin provides the [[ikiwiki/directive/trailoptions]], -[[ikiwiki/directive/traillink]], [[ikiwiki/directive/trailitem]], -[[ikiwiki/directive/trailitems]] -and [[ikiwiki/directive/trailinline]] [[directives|ikiwiki/directive]]. - -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. - -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]]. - -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. - -The [[ikiwiki/directive/trailoptions]] directive sets options for the -entire trail. - -Pages can be included in a trail in various ways: - -* 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: - - \[[!trailinline pages="page(./posts/*) and !*/Discussion" archive=yes - feedshow=10 quick=yes]] - - This directive only works if the [[!iki plugins/inline desc=inline]] - plugin is also enabled. - -* The [[ikiwiki/directive/trailitems]] 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. - -* 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: - - * [[!traillink Introduction]] - * [[!traillink "Chapter 1"]] - * [[!traillink Chapter_2]] - * [[!traillink Appendix_A]] - - or - - 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]]`: - - 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]] - - Like `\[[!tag]]`, this still counts as a [[ikiwiki/WikiLink]] even though - there's no visible link. - -You can mix several of these directives in one page. The resulting -trail will contain all of the pages matched by any of the directives, -in the same order that the directives appear (unless you use the `sort` or -`reverse` options on `\[[!trailoptions]]`). diff --git a/doc/plugins/trail.mdwn b/doc/plugins/trail.mdwn new file mode 100644 index 000000000..14b97e35a --- /dev/null +++ b/doc/plugins/trail.mdwn @@ -0,0 +1,76 @@ +[[!template id=plugin name=trail author="[[Simon_McVittie|smcv]]"]] +[[!tag type/chrome]] + +This plugin provides the [[ikiwiki/directive/trailoptions]], +[[ikiwiki/directive/traillink]], [[ikiwiki/directive/trailitem]], +and [[ikiwiki/directive/trailitems]] [[directives|ikiwiki/directive]]. + +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. + +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]]. + +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. + +The [[ikiwiki/directive/trailoptions]] directive sets options for the +entire trail. + +Pages can be included in a trail in various ways: + +* The [[ikiwiki/directive/inline]] directive with `trail="yes"` 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: + + \[[!inline pages="page(./posts/*) and !*/Discussion" archive=yes + feedshow=10 quick=yes trail=yes]] + + This only works if the trail and [[!iki plugins/inline desc=inline]] + plugins are both enabled. + +* The [[ikiwiki/directive/trailitems]] 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. + +* 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: + + * [[!traillink Introduction]] + * [[!traillink "Chapter 1"]] + * [[!traillink Chapter_2]] + * [[!traillink Appendix_A]] + + or + + 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]]`: + + 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]] + + Like `\[[!tag]]`, this still counts as a [[ikiwiki/WikiLink]] even though + there's no visible link. + +You can mix several of these directives in one page. The resulting +trail will contain all of the pages matched by any of the directives, +in the same order that the directives appear (unless you use the `sort` or +`reverse` options on `\[[!trailoptions]]`). diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index dcab041dc..d62ab6e63 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -356,6 +356,22 @@ when the page is being previewed.) The function is passed named parameters: "page" and "content", and should return the formatted content. +### build_affected + + hook(type => "build_affected", id => "foo", call => \&build_affected); + +This hook is called after the directly changed pages have been built, +and can cause extra pages to be built. If links and backlinks were provided +by a plugin, this would be where that plugin would rebuild pages whose +backlinks have changed, for instance. The [[trail]] plugin uses this hook +to rebuild pages whose next or previous page has changed. + +The function should currently ignore its parameters. It returns a list with +an even number of items (a hash in list context), where the first item of +each pair is a page name to be rebuilt (if it was not already rebuilt), and +the second is a log message resembling +`building plugins/write because the phase of the moon has changed`. + ### delete hook(type => "delete", id => "foo", call => \&delete); diff --git a/doc/style.css b/doc/style.css index 7bbfe5d2a..35a133198 100644 --- a/doc/style.css +++ b/doc/style.css @@ -501,3 +501,38 @@ a.openid_large_btn:focus { .fileupload-content .ui-progressbar-value { background: url(ikiwiki/images/pbar-ani.gif); } + +.trail { + display: block; + clear: both; + position: relative; +} + +.trailprev { + display: block; + text-align: left; + position: absolute; + top: 0%; + left: 3%; + width: 30%; +} + +.trailup { + display: block; + text-align: center; + margin-left: 35%; + margin-right: 35%; +} + +.trailnext { + display: block; + text-align: right; + position: absolute; + top: 0%; + width: 30%; + right: 3%; +} + +.trailsep { + display: none; +} diff --git a/doc/templates.mdwn b/doc/templates.mdwn index d189fa073..43bf9ee51 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -80,6 +80,8 @@ Here is a full list of the template files used: * `autotag.tmpl` - Filled in by the tag plugin to make tag pages. * `calendarmonth.tmpl`, `calendaryear.tmpl` - Used by ikiwiki-calendar to make calendar archive pages. +* `trails.tmpl` - Used by the trail plugin to generate links on each page + that is a member of a trail. * `editpage.tmpl`, `editconflict.tmpl`, `editcreationconflict.tmpl`, `editfailedsave.tmpl`, `editpagegone.tmpl`, `pocreatepage.tmpl`, `editcomment.tmpl` `commentmoderation.tmpl`, `renamesummary.tmpl`, |