create new tag
, view all tags

SpacedWikiWordPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on SpacedWikiWordPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below
• See SpacedWikiWordPluginDevArchive for older discussions.

Feedback on SpacedWikiWordPlugin

-- MartinCleaver, ArthurClemens

I have updated the plugin with a number of features/fixes:

  • Now uses TWiki core space out function, so TWiki is no longer spaced out as T Wiki
  • Links in bracket notation are now spaced out as well
    • [[WikiWord][See WikiWord]] has an explicit link label: is not spaced out
    • [[WikiWord]] has no explicit link label: is spaced out
  • Support for underscore topic links
  • %SPACEOUT{}% can be called on underscore topic links as well
  • Anchor dashes are removed: [[#SeeAbove]] is rendered as See Above

-- ArthurClemens - 04 May 2007

I was getting an error that TWiki::Func::spaceOutWikiWord does not exist, so I replaced the #else newer by a real else statement.

-- JohnFitzpatrick - 05 May 2007

Thanks for the call. I've updated the plugin.

-- ArthurClemens - 05 May 2007

I've tweaked the regexes a little so SomeDNSConfig will display as 'Some DNS Config' instead of 'Some DNSConfig' by adding the first line:

    $linkLabel =~ s/([$upperAlphaRegex]+)([$upperAlphaRegex][$lowerAlphaRegex$numericRegex]+)/$1$separator$2/go;
    $linkLabel =~ s/([$lowerAlphaRegex])([$upperAlphaRegex$numericRegex]+)/$1$separator$2/go;
    $linkLabel =~ s/([$numericRegex])([$upperAlphaRegex])/$1$separator$2/go;

-- WadeTurland - 20 Sep 2007

The regexes are in the TWiki Core code (TWiki.pm).

-- ArthurClemens - 20 Sep 2007

I haven't found the regular expressions in TWiki.pm, but in lib/TWiki/Plugins/SpacedWikiWordPlugin.pm.

-- FrankSpangenberg - 24 Sep 2007

These are deprecated and will not be called by the plugin with TWiki 4.2.

-- ArthurClemens - 24 Sep 2007

With the additional regex from Wade TWiki gets spaced out, even if I add it to DONTSPACE. frown

-- FrankSpangenberg - 25 Sep 2007

To be able to have 'override' twiki words where you can get TheTopicName rendered as The TopicName, add the following to initPlugin in SpacedWikiWordsPlugin.pm

my $overrideWords = &TWiki::Func::getPreferencesValue("OVERRIDE")
     || &TWiki::Func::getPreferencesValue("SPACEDWIKIWORDPLUGIN_OVERRIDE");
   $overrideWords =~ s/ //go;
   @overrideSet = split( ',', $overrideWords );

And the following to renderWikiWordHandler before the line that returns $linkLabel if its in $dontSpaceSet

#return override value
   foreach my $word (@overrideSet)
      my @values = split("=", $word);
      if (@values[0] eq $linkLabel)
        ($result = @values[1]) =~ s/\+/ /g;
        return $result;

Then use the setting OVERRIDE in the SpacedWikiWordsPlugin preferences in format TheTopicName=The+TopicName (where '+' is where you want the space). Seperate any others using commas as normal.

-- TomBriden - 22 Nov 2007

I've also added a comment to BreadCrumbsPluginDev to add code to it if you want your breadcrumbs spaced using this plugin.

-- TomBriden - 22 Nov 2007

How do I apply this plugin to WebSearch?

-- TamsinTweddell - 15 Apr 2008

I have now found a solution to my problem: modify the template search.pattern.tmpl such that %TMPL:DEF{"result"}% has %TOPICNAME% replaced with %SPACEOUT{%TOPICNAME%}%

-- TamsinTweddell - 18 Apr 2008

Edit | Attach | Watch | Print version | History: r88 < r87 < r86 < r85 < r84 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r88 - 2008-04-18 - TamsinTweddell
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.