From 96125d8da512d992012560a1115eb3a8115bafbe Mon Sep 17 00:00:00 2001 From: joey Date: Wed, 14 Feb 2007 04:05:08 +0000 Subject: [PATCH] * Allow multiple tag settings to appear in a single page. --- IkiWiki/Plugin/tag.pm | 12 ++++++------ debian/changelog | 3 ++- doc/bugs/problem_adding_tag_from_template.mdwn | 3 +++ doc/plugins/htmlscrubber.mdwn | 2 +- doc/plugins/inline.mdwn | 1 - doc/plugins/mdwn.mdwn | 2 +- doc/plugins/passwordauth.mdwn | 1 - doc/plugins/template.mdwn | 9 +++++---- po/ikiwiki.pot | 2 +- 9 files changed, 19 insertions(+), 16 deletions(-) diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 29d1d030a..b06eadd13 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -41,9 +41,8 @@ sub preprocess (@) { #{{{ delete $params{page}; delete $params{destpage}; - $tags{$page} = []; foreach my $tag (keys %params) { - push @{$tags{$page}}, $tag; + $tags{$page}{$tag}=1; # hidden WikiLink push @{$links{$page}}, tagpage($tag); } @@ -60,13 +59,14 @@ sub pagetemplate (@) { #{{{ $template->param(tags => [ map { link => htmllink($page, $destpage, tagpage($_)) - }, @{$tags{$page}} - ]) if exists $tags{$page} && @{$tags{$page}} && $template->query(name => "tags"); + }, sort keys %{$tags{$page}} + ]) if exists $tags{$page} && %{$tags{$page}} && $template->query(name => "tags"); if ($template->query(name => "categories")) { # It's an rss/atom template. Add any categories. - if (exists $tags{$page} && @{$tags{$page}}) { - $template->param(categories => [map { category => $_ }, @{$tags{$page}}]); + if (exists $tags{$page} && %{$tags{$page}}) { + $template->param(categories => [map { category => $_ }, + sort keys %{$tags{$page}}]); } } } # }}} diff --git a/debian/changelog b/debian/changelog index 80a47c458..f4e4e2437 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,8 +15,9 @@ ikiwiki (1.43) UNRELEASED; urgency=low preprocessing it. * Fix smiley plugin to support smileys at the very beginning or end of the content. + * Allow multiple tag settings to appear in a single page. - -- Joey Hess Tue, 13 Feb 2007 18:40:36 -0500 + -- Joey Hess Tue, 13 Feb 2007 22:40:56 -0500 ikiwiki (1.42) unstable; urgency=low diff --git a/doc/bugs/problem_adding_tag_from_template.mdwn b/doc/bugs/problem_adding_tag_from_template.mdwn index bc697e487..0d1cf45a8 100644 --- a/doc/bugs/problem_adding_tag_from_template.mdwn +++ b/doc/bugs/problem_adding_tag_from_template.mdwn @@ -5,3 +5,6 @@ page that used `core=1` in the template (such as [[plugins/mdwn]]), the `type/core` tag disappeared, and the template did not supply it. --[[JoshTriplett]] +Problem was that setting a tag cleared all earlier tags. [[bugs/done]], and +I like the idea of the autotagging.. +--[[Joey]] diff --git a/doc/plugins/htmlscrubber.mdwn b/doc/plugins/htmlscrubber.mdwn index 4fa11d04e..8e37a5bd5 100644 --- a/doc/plugins/htmlscrubber.mdwn +++ b/doc/plugins/htmlscrubber.mdwn @@ -1,5 +1,5 @@ [[template id=plugin name=htmlscrubber core=1 author="[[Joey]]"]] -[[tag type/html type/core]] +[[tag type/html]] This plugin is enabled by default. It sanitizes the html on pages it renders to avoid XSS attacks and the like. diff --git a/doc/plugins/inline.mdwn b/doc/plugins/inline.mdwn index 6baf6ba9b..a607474df 100644 --- a/doc/plugins/inline.mdwn +++ b/doc/plugins/inline.mdwn @@ -1,5 +1,4 @@ [[template id=plugin name=inline core=1 author="[[Joey]]"]] -[[tag type/core]] This is a [[PreProcessorDirective]] that allows including one wiki page inside another. For example: diff --git a/doc/plugins/mdwn.mdwn b/doc/plugins/mdwn.mdwn index 277c4f3ec..c4de0cff9 100644 --- a/doc/plugins/mdwn.mdwn +++ b/doc/plugins/mdwn.mdwn @@ -1,5 +1,5 @@ [[template id=plugin name=mdwn core=1 author="[[Joey]]"]] -[[tag type/format type/core]] +[[tag type/format]] This plugin lets ikwiki convert files with names ending in ".mdwn" to html. It uses the [[markdown]] minimal markup language. diff --git a/doc/plugins/passwordauth.mdwn b/doc/plugins/passwordauth.mdwn index 3d6782dba..2ee06b7ad 100644 --- a/doc/plugins/passwordauth.mdwn +++ b/doc/plugins/passwordauth.mdwn @@ -1,6 +1,5 @@ [[template id=plugin name=passwordauth core=1 author="[[Joey]]"]] [[tag type/auth]] -[[tag type/core]] This plugin lets ikiwiki prompt for a user name and password when logging into the wiki. It also handles registering users, mailing passwords, and diff --git a/doc/plugins/template.mdwn b/doc/plugins/template.mdwn index b6083d225..98188d7dc 100644 --- a/doc/plugins/template.mdwn +++ b/doc/plugins/template.mdwn @@ -38,10 +38,6 @@ few things: * To use one block of text if a variable is set and a second if it's not, use `textother text` -The filled out template will be formatted the same as the rest of the page -that contains it, so you can include WikiLinks and all other forms of wiki -markup in the template. - Here's a sample template: @@ -57,3 +53,8 @@ Here's a sample template: + +The filled out template will be formatted the same as the rest of the page +that contains it, so you can include WikiLinks and all other forms of wiki +markup in the template. Note though that such WikiLinks will not show up as +backlinks to the page that uses the template. diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index fd29aba17..1b63d45dd 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-02-13 19:10-0500\n" +"POT-Creation-Date: 2007-02-13 22:40-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -- 2.32.0.93.g670b81a890