]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Add taglink preprocessor directive, supporting visible tag links.
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 20 Sep 2007 18:59:27 +0000 (18:59 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 20 Sep 2007 18:59:27 +0000 (18:59 +0000)
Closes: #443344
IkiWiki/Plugin/tag.pm
debian/changelog
doc/news/version_2.6.1.mdwn
doc/plugins/tag.mdwn
doc/tags.mdwn
po/ikiwiki.pot

index bae8e14327d5e2761e01a8aeddd33566e0741c04..29af3757630d880f320c21b5bb8191777487892d 100644 (file)
@@ -10,7 +10,8 @@ my %tags;
 
 sub import { #{{{
        hook(type => "getopt", id => "tag", call => \&getopt);
-       hook(type => "preprocess", id => "tag", call => \&preprocess, scan => 1);
+       hook(type => "preprocess", id => "tag", call => \&preprocess_tag, scan => 1);
+       hook(type => "preprocess", id => "taglink", call => \&preprocess_taglink, scan => 1);
        hook(type => "pagetemplate", id => "tag", call => \&pagetemplate);
 } # }}}
 
@@ -32,7 +33,7 @@ sub tagpage ($) { #{{{
        return $tag;
 } #}}}
 
-sub preprocess (@) { #{{{
+sub preprocess_tag (@) { #{{{
        if (! @_) {
                return "";
        }
@@ -52,6 +53,18 @@ sub preprocess (@) { #{{{
        return "";
 } # }}}
 
+sub preprocess_taglink (@) { #{{{
+       if (! @_) {
+               return "";
+       }
+       preprocess_tag(@_);
+       my %params=@_;
+       delete $params{page};
+       delete $params{destpage};
+       delete $params{preview};
+       return join(" ", map { "[[$_]]" } keys %params);
+} # }}}
+
 sub pagetemplate (@) { #{{{
        my %params=@_;
        my $page=$params{page};
index 7a164b83c552dfee5cdbd41d85806b6d66364648..d0f1e99aa1195b72979ea7c254ba766f3dd6568a 100644 (file)
@@ -1,8 +1,10 @@
 ikiwiki (2.9) UNRELEASED; urgency=low
 
   * Fix copyright and licence styling.
+  * Add taglink preprocessor directive, supporting visible tag links.
+    Closes: #443344
 
- -- Joey Hess <joeyh@debian.org>  Thu, 20 Sep 2007 14:06:14 -0400
+ -- Joey Hess <joeyh@debian.org>  Thu, 20 Sep 2007 14:57:52 -0400
 
 ikiwiki (2.8) unstable; urgency=low
 
index 2388ff587123e9d5e507f6a82d13781f381c5980..2aea23479157186e8ad4180f5d8032ea84937bde 100644 (file)
@@ -4,4 +4,4 @@ ikiwiki 2.6.1 released with [[toggle text="these changes"]]
    * Fix minor bug when blogging by cgi, introduced in last version.
    * Fix a bug in unlockwiki intorduced last version that made it crash ikiwiki
      if it wasn't locked when called. This is known to break post-commit
-     emails."""]]
\ No newline at end of file
+     emails."""]]
index 2f541e532afb8a6104292352dd4414ceec035d5d..c221624cda34c636172334e868a616a3d7f6ddae 100644 (file)
@@ -11,6 +11,10 @@ tagged with a given tag, for example. The tags will also show up on blog
 entries and at the bottom of the tagged pages, as well as in RSS and Atom
 feeds.
 
+If you want a visible [[WikiLink]] along with the tag, use taglink instead:
+
+       \[[taglink foo]]
+
 This plugin has a configuration option. Set --tagbase=tags and links to tags
 will be located under the specified base page. If ikiwiki is configured
 this way, then the example above actually tags the page with the tags
index 8d3a85cef0ecd54fbfef86bac015fb6c85663602..cd54fed36c689a031c0e06c93bf790bbdb632f33 100644 (file)
@@ -2,17 +2,21 @@ While ikiwiki supports hierarchically categorising pages by creating
 [[SubPage]]s, that's often not flexible enough, and it can also be useful
 to tag pages in various non-hierarchical ways.
 
-Since this is a wiki, tagging is just a form of linking. For example, since
-this page links to [[features]], it can be considered to have something to
-do with ikiwiki's features. If you want to put pages into a category, the
-typical wiki way to do so is to create a "CategoryFoo" page and link pages
-in the category to it. That is just another form of tagging.
+Since this is a wiki, tagging is just a form of linking. The general rule
+is that all tags are links, but not all links are tags. So a tag is a
+special link that ikiwiki knows is intended to be used as a tag.
 
-Sometimes you may want to tag a page without putting a visible link on it.
+Generally you will tag a page without putting a visible link on it.
 The [[tag_plugin|plugins/tag]] allows you to do so, like this:
 
        \[[tag mytag othertag thirdtag]]
 
+You can also tag a page with a visible link:
+
+       \[[taglink mytag]]
+
+This tag will be displayed just like a regular [[WikiLink]].
+
 One way to use these tags is to create a [[blog]] of pages that have a
 particular set of tags. Or just look at the [[BackLinks]] to a tag page to
 see all the pages that are tagged with it. [[Plugins]] can be written to do
index ee27618844c78a7f9545d5f50ba09e6e02332c62..d15ee8ff1f171fd00e22b1a4a45d1600dd250b14 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-09-16 20:05-0400\n"
+"POT-Creation-Date: 2007-09-20 14:58-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"