diff options
author | Simon McVittie <smcv@debian.org> | 2010-04-02 00:28:02 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2010-04-04 00:43:48 +0100 |
commit | c1a42e76bc6667bfb2882a12d53c25d9f952ca82 (patch) | |
tree | f540ca41ab5668dd417c4df17b64af2aa0ee83e0 /doc/plugins | |
parent | 05b6e8ceee2bec4442727e2475abf8a8861d5e0a (diff) | |
download | ikiwiki-c1a42e76bc6667bfb2882a12d53c25d9f952ca82.tar ikiwiki-c1a42e76bc6667bfb2882a12d53c25d9f952ca82.tar.gz |
implement typed links; add tagged_is_strict config option
Diffstat (limited to 'doc/plugins')
-rw-r--r-- | doc/plugins/tag.mdwn | 5 | ||||
-rw-r--r-- | doc/plugins/write.mdwn | 21 |
2 files changed, 25 insertions, 1 deletions
diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn index 8ff70a069..8cd79da41 100644 --- a/doc/plugins/tag.mdwn +++ b/doc/plugins/tag.mdwn @@ -8,6 +8,11 @@ These directives allow tagging pages. It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to match pages that are tagged with a specific tag. +If the `tagged_is_strict` config option is set, `tagged()` will only match +tags explicitly set with [[ikiwiki/directive/tag]] or +[[ikiwiki/directive/taglink]]; if not (the default), it will also match +any other [[WikiLinks|ikiwiki/WikiLink]] to the tag page. + [[!if test="enabled(tag)" then=""" This wiki has the tag plugin enabled, so you'll see a note below that this page is tagged with the "tags" tag. diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 96a2aa16d..fe7cf0183 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -633,6 +633,22 @@ reference. Do not modify this hash directly; call `add_link()`. $links{"foo"} = ["bar", "baz"]; +### `%typedlinks` + +The `%typedlinks` hash records links of specific types. Do not modify this +hash directly; call `add_link()`. The keys are page names, and the values +are hash references. In each page's hash reference, the keys are link types +defined by plugins, and the values are hash references with link targets +as keys, and 1 as a dummy value, something like this: + + $typedlinks{"foo"} = { + tag => { short_word => 1, metasyntactic_variable => 1 }, + next_page => { bar => 1 }, + }; + +Ordinary [[WikiLinks|ikiwiki/WikiLink]] appear in `%links`, but not in +`%typedlinks`. + ### `%pagesources` The `%pagesources` has can be used to look up the source filename @@ -939,11 +955,14 @@ Optionally, a third parameter can be passed, to specify the preferred filename of the page. For example, `targetpage("foo", "rss", "feed")` will yield something like `foo/feed.rss`. -### `add_link($$)` +### `add_link($$;$)` This adds a link to `%links`, ensuring that duplicate links are not added. Pass it the page that contains the link, and the link text. +An optional third parameter sets the link type (`undef` produces an ordinary +[[ikiwiki/WikiLink]]). + ## Miscellaneous ### Internal use pages |