Tags:
create new tag
view all tags
Question

My manager at work has said that he has difficulty reading WikiWords and would like them to be rendered spaced out. (Shock horror!)

Has anyone already written something to display all WikiWords as "Wiki Words"?

Personally I like WikiWords whole so I would be seeking to find a way to have this as a per-user setting.

  • TWiki version: Dec 2000
  • Web server: Apache
  • Server OS: NT

Thanks very much.

-- MartinCleaver - 02 Mar 2001

Answer

See the TextFormattingRules

Forced Links: You can create a forced internal link by enclosing words in double square brackets.

[[This is a wiki link with spaces]]
should result in This is a wiki link with spaces

This is even better then a 'per user' setting since it's a 'per link' choice.

-- DavidLeBlanc - 07 Mar 2001

Thanks for your answer David.

The reason we wanted it was because we wanted the site to look non-Wiki to non Wiki people but simple as possible to author.

I implemented a blanket rule to always render with spaces.

Here's the code:

In wiki.pm in internalLink, just before the end when it calls topicExists:

    $text=spacedWikiWord($text);
    topicExists( $web, $page) ? ...
    ...
}

sub spacedWikiWord
{
    my ( $word ) =  @_;
    $word =~ s/([^^A-Z ])([A-Z])/$1 $2/g;    #TJC/KB

    return $word;
}

I'm really starting to like the non-wikiness of this. Perhaps my manager was right..!

-- MartinCleaver - 9 Mar 2001

Oops, my bad! I get it now: you want SquashedWords to display as Unsquashed Words!

-- DavidLeBlanc - 09 Mar 2001

Yup, and if you want to see it in action, take a look at my village website: http://www.redbourn.org.uk/

-- MartinCleaver - 10 Mar 2001

For Changing WikiWords in the templates (page title, signature) see CanIRenderWikiWordsSpacedOutInTemplates.

--Main.TWikiGuest - 03 April 2001

Variant: in spacedWikiWord, to see JavaOne2001 as Java One 2001 you may want to use instead of the line #TJC/KB, the lines:

  $word =~ s/([a-z0-9])([A-Z])/$1 $2/g; #lower alphanum followed by upper
  $word =~ s/([a-zA-Z])([0-9])/$1 $2/g; #letter followed by number
-- ColasNahaboo - 09 Apr 2001

Thanks, I will add it to my forthcoming plugin...

-- MartinCleaver - 15 Nov 2001

Done: SpacedWikiWordPlugin

-- MartinCleaver - 14 Apr 2002

The latest SpreadSheetPlugin has now a $PROPERSPACE() formula that spaces out WikiWords.

-- PeterThoeny - 07 Mar 2004

Hi,

this function can separate better the wiki words when it have acronym or abbreviation in the middle.

Example: my WikiName is AurelioAHeckert, but it translates to Aurelio AHeckert... the best way is Aurelio A Heckert. (The realy right is Aurelio A. Heckert but RegExp is not magic)

I did a test and god result hire: http://twiki.im.ufba.br/bin/view/Test/RegExpSepararWikiNames
(with tests)

I did in javascript. I think it's good. But, we need more I18N. Somebody can translate it to Perl?
-- AurelioAHeckert - 18 Feb 2005

Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r14 - 2005-02-18 - AurelioAHeckert
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.