commit
914c839ceb
|
@ -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
|
||||
|
|
|
@ -17,6 +17,8 @@ ikiwiki (2.72) unstable; 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 <joeyh@debian.org> Wed, 24 Dec 2008 19:49:32 -0500
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
Camelcase currently looks for any and call camelcase words and turns them into wiki links. This patch adds a config item called <code>camelcase_ignore</code> which is an array of camelcase words to ignore.
|
||||
|
||||
<pre>
|
||||
--- /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};
|
||||
</pre>
|
||||
|
||||
--[[puck]]
|
||||
|
||||
[[done]]
|
|
@ -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]]
|
||||
|
|
Loading…
Reference in New Issue