From 4d1d4db92797b5aa74c4aff0cc24ab8ade3c1f43 Mon Sep 17 00:00:00 2001 From: "http://puck.openid.org/" Date: Tue, 23 Dec 2008 17:48:05 -0500 Subject: [PATCH 1/5] --- doc/todo/Allow_disabling_edit_and_preferences_links.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn b/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn index 523a1f4da..1188d1ab2 100644 --- a/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn +++ b/doc/todo/Allow_disabling_edit_and_preferences_links.mdwn @@ -38,3 +38,11 @@ Patch: > really want to disable the editpage plugin in the setup file for the > public, static wiki. Sounds like you might also want to turn off cgi > entirely for that build. --[[Joey]] + +>> I want to retain the same page.tmpl for both sites (different templates +>> will just increase the maintenance hell), so disabling the links in the +>> config for one public site works better in my case. +>> +>> I do have the editpage plugin disabled for the public static wiki, but +>> the link still appears on the site. I want to keep the cgi on, so that +>> the site is still searchable. --[[puck]] From 20731f761f7b378934bf3b86dbec20c167464d5f Mon Sep 17 00:00:00 2001 From: "http://puck.openid.org/" Date: Tue, 23 Dec 2008 18:05:38 -0500 Subject: [PATCH 2/5] --- doc/todo/Add_camelcase_exclusions.mdwn | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 doc/todo/Add_camelcase_exclusions.mdwn diff --git a/doc/todo/Add_camelcase_exclusions.mdwn b/doc/todo/Add_camelcase_exclusions.mdwn new file mode 100644 index 000000000..40737c2a0 --- /dev/null +++ b/doc/todo/Add_camelcase_exclusions.mdwn @@ -0,0 +1,21 @@ +Camelcase currently looks for any and call camelcase words and turns them into wiki links. This patch adds a config item called camelcase_ignore which is an array of camelcase words to ignore. + +
+--- /usr/share/perl5/IkiWiki/Plugin/camelcase.pm.orig   2008-12-24 11:49:14.000000000 +1300
++++ /usr/share/perl5/IkiWiki/Plugin/camelcase.pm        2008-12-24 12:02:21.000000000 +1300
+@@ -33,7 +33,11 @@
+        my $destpage=$params{destpage};
+ 
+        $params{content}=~s{$link_regexp}{
+-               htmllink($page, $destpage, IkiWiki::linkpage($1))
++                if (grep {/$1/} @{ $config{'camelcase_ignore'} }) {
++                  $1
++                } else {
++                 htmllink($page, $destpage, IkiWiki::linkpage($1)) 
++                }
+        }eg;
+ 
+        return $params{content};
+
+ +--[[puck]] From c9e65fded187f7160a6345ea7f697402c246be06 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 23 Dec 2008 19:11:03 -0500 Subject: [PATCH 3/5] camelcase: Add camelcase_ignore setting. --- IkiWiki/Plugin/camelcase.pm | 18 +++++++++++++++--- debian/changelog | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/camelcase.pm b/IkiWiki/Plugin/camelcase.pm index 6c1fafb7b..f9ee30fe2 100644 --- a/IkiWiki/Plugin/camelcase.pm +++ b/IkiWiki/Plugin/camelcase.pm @@ -33,7 +33,14 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, - }; + }, + camelcase_ignore => { + type => "string", + example => [], + description => "list of words to not turn into links", + safe => 1, + rebuild => undef, # might change links + }, } sub linkify (@) { @@ -42,7 +49,7 @@ sub linkify (@) { my $destpage=$params{destpage}; $params{content}=~s{$link_regexp}{ - htmllink($page, $destpage, linkpage($1)) + ignored($1) ? $1 : htmllink($page, $destpage, linkpage($1)) }eg; return $params{content}; @@ -54,8 +61,13 @@ sub scan (@) { my $content=$params{content}; while ($content =~ /$link_regexp/g) { - push @{$links{$page}}, linkpage($1); + push @{$links{$page}}, linkpage($1) unless ignored($1) } } +sub ignored ($) { + my $word=lc shift; + grep { $word eq lc $_ } @{$config{'camelcase_ignore'}} +} + 1 diff --git a/debian/changelog b/debian/changelog index 2c8931735..7a8985171 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ikiwiki (2.72) UNRELEASED; urgency=low * Avoid comments in recentchanges being broken links (smcv) * Add deprecation warning for GlobLists, which will stop working in 3.0. + * camelcase: Add camelcase_ignore setting. -- Joey Hess Mon, 22 Dec 2008 19:02:16 -0500 From e3b7d1892949090fd1f11e9a211b556b20558069 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 23 Dec 2008 20:08:01 -0500 Subject: [PATCH 4/5] close --- doc/todo/Add_camelcase_exclusions.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/Add_camelcase_exclusions.mdwn b/doc/todo/Add_camelcase_exclusions.mdwn index 40737c2a0..6b86132a0 100644 --- a/doc/todo/Add_camelcase_exclusions.mdwn +++ b/doc/todo/Add_camelcase_exclusions.mdwn @@ -19,3 +19,5 @@ Camelcase currently looks for any and call camelcase words and turns them into w --[[puck]] + +[[done]] From 0d406010ff8ffb8d891318bbaf6b6de1e2cb2578 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 25 Dec 2008 16:31:58 -0500 Subject: [PATCH 5/5] googlecalendar: Add runtime deprecation warning. --- IkiWiki/Plugin/googlecalendar.pm | 2 ++ debian/changelog | 1 + 2 files changed, 3 insertions(+) diff --git a/IkiWiki/Plugin/googlecalendar.pm b/IkiWiki/Plugin/googlecalendar.pm index 9e09d7dbb..24c2e1527 100644 --- a/IkiWiki/Plugin/googlecalendar.pm +++ b/IkiWiki/Plugin/googlecalendar.pm @@ -5,6 +5,8 @@ use warnings; use strict; use IkiWiki 2.00; +print STDERR "warning: the googlecalendar plugin is deprecated and will be removed in ikiwiki 3.0 (use the embed plugin instead)\n"; + sub import { hook(type => "getsetup", id => "googlecalendar", call => \&getsetup); diff --git a/debian/changelog b/debian/changelog index 7a8985171..19b8cbdf7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ ikiwiki (2.72) UNRELEASED; urgency=low * Avoid comments in recentchanges being broken links (smcv) * Add deprecation warning for GlobLists, which will stop working in 3.0. * camelcase: Add camelcase_ignore setting. + * googlecalendar: Add runtime deprecation warning. -- Joey Hess Mon, 22 Dec 2008 19:02:16 -0500