SpacedWikiWordPlugin

Automatically display topic links spaced out: [SpacedWikiWordPlugin is displayed as Spaced Wiki Word Plugin.

AND/OR

Display "underscore topic names" like Topic_name as Topic name.

This plugin also overrides the core SPACEOUT macro to improve the presentation of spaced out words, and allow for a DONTSPACE list.

Options

Spaced out WikiWords definitely make links more readable, but they can also produce "Odd Looking Sentence Case" links.

Use underscore topic names if you want total control over links:
  1. (Optionally) disable automatic linking of WikiWords. Do this if you are in the position to teach your users to only write links in bracket notation like [[WebHome]]. This is also how Wikipedia links are written. Bracket notation is necessary to create links for underscore topic names, but you can also mix both link notations.
  2. Use bracket notation without explicit link labels:
    • [[WebHome][WebHome]] - explicit link label, no spacing out
    • [[WebHome]] - link is label, so no explicit link label: this is spaced out
  3. Use underscores to create natural looking links:
    • A topic name such as [[Human_evolution]] will be rendered as Human evolution
    • Plain topic names like Human_evolution are not expanded; always use bracket notation

wiki words are automatically spaced out. Automatically spaced out are: TopicName, Web.TopicName, [[TopicName]].

Explicitly written link labels are not spaced out. Examples: [[TopicName][TopicName]] or [[TopicName][SomeOtherName]].

[[Underscore_topic]] is automaticlly spaced out (but not Underscore_topic).

Spacing out search results

Use the SPACEOUT macro. For example, write:

[[$web.$topic][$percntSPACEOUT{$topic}$percnt]]

to generate: Spaced Wiki Word Plugin

More info on search syntax in FormattedSearch.

Preventing spacing out of some words

Some words (often brand names and medical terms) are written in CamelCase notation and should not be spaced out. For example: CamelCase, DaimlerChrysler, MasterCard.

Define a list of words that should not get spaced out with DONTSPACE in your prefereces.

Troubleshooting

  • At Plugin test below, check if this plugin is enabled and if the correct spacing settings are applied.
  • You have used an explicit link label: with [[WebHome][WebHome]], "WebHome" is not spaced out. Use [[WebHome]] or [[WebHome][%SPACEOUT{"WebHome"}%]]
  • You have used underscore topic names without bracket notation. Always write [[Human_evolution]]
  • You are showing links from a search result. See #SearchResults above.

Some words are spaced out, but shouldn't be

See #PreventingSpaceOut.

Settings

You can control the behaviour of the plugin using the following PreferenceSettings:
  • DONTSPACE can be set to a commaa-separated list of words that should not be spaced out
  • SPACE_OUT_WIKI_WORD_LINKS can be set to 1/0 to enable/disable spacing out WikiWord links to Wiki Word links
  • SPACE_OUT_UNDERSCORE_LINKS can be set to 1/0 to enable/disable spacing out Topic_name links to Topic name links
  • REMOVE_ANCHOR_DASHES can be set to 1/0 to enable/disable removing anchor dashes when writing [[#SomeAnchor]]
All these settings are on by default.

Tests

If the plugin is installed and enabled:
  • SPACE_OUT_WIKI_WORD_LINKS
  • SPACE_OUT_UNDERSCORE_LINKS
  • REMOVE_ANCHOR_DASHES
  • DONTSPACE (comma-separated list of things not to space)

  • Plain Wikiword: SpacedWikiWordPlugin, ODDsAndEnds, AsYouLikeIt, JustAMinute
  • Wikiword in brackets: SpacedWikiWordPlugin
  • Underscore_topic link: Spaced_Wiki_Word_Plugin
  • Anchor dashes: #TestHere
  • Pluralised ACRONYMs like JETs should not be spaced
  • %SPACEOUT{"WishUponAStar"}%: Wish Upon A Star

Installation Instructions

ALERT! WARNING: this plugin is designed for Foswiki 2.0 and later. It may work on some earlier Foswiki versions, but has not been tested with them.

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab -> "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button. Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will not show up in the search results.

You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> install

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See https://foswiki.org/Support/ManuallyInstallingExtensions for more help.

History

12 July 2017 Crawford Currie: rewrote for Foswiki 2
10 Nov 2010 Padraig Lennon: Foswikitask:Item9994 - Fix Release Version
23 Nov 2007 Arthur Clemens: made compatible to Foswiki; allow DONTSPACE to separated words by spaces.
05 May 2007 Arthur Clemens: fixed a wrong function call, thanks TWiki:Main.JohnFitzpatrick.
04 May 2007 Arthur Clemens: spacing out uses a Core function (from Plugins version 1.13; fallback for older versions); added support for spacing out of "underscore topic names"; added optional removal of anchor dashes.
20 Apr 2007 Arthur Clemens: updated with regexes from TWiki Core spaceOutWikiWord; added DONTSPACE option.
12 Apr 2004 Updated for TWiki 3
14 Apr 2002 First release
Topic revision: r1 - 12 Apr 2004, ProjectContributor
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback