key Log In or Register to edit

GluePlugin

Description

This plugin will help you to write readable TWikiML by allowing tags and arguments to be formatted on multiple lines. This is done by removing whitespaces surrounding tilde characters at the beginning of a line and recombine consecutive lines again. Basically, there are two was of glueing and recombining lines by either removing all whitespaces between two lines or by removing all whitespaces and separateing lines with a single space. In addition, there's a helper character sequence that prevents the TWiki engine to interprete tags before the Glue Plugin could reformat the text.

Syntax

Line prefix Action
~~~<space> combine lines by removing all, insert one whitespaces
*~~<space> recombine lines by removing any whitespaces between them
%~~<space> escape tag interpretation

The <space> is a literal whitespace blank. The ~~~<space> and *~~<space> sequences are recognized only at the beginning of a line, whereas the %~~<space> escape sequence might appear everywhere. The basic anatomy of writing a TWiki tag using the Glue Plugin is exemplified by

%~~ TAG{
~~~ key="
*~~      hello
~~~      world
*~~ "
~~~ }%
which will be recombined to
%<nop>TAG{ key="hello world" }%

Examples

You type:
This is a line
~~~ glued to another line.
You get (faked):
This is a line glued to another line.
You get if installed:
This is a line 
~~~ glued to another line.

You type:
Glue
*~~ Plugin
You get (faked):
Glue Plugin
You get if installed:
Glue *~~ Plugin

You type:
Apples

~~~  

And

~~~

Oranges
You get (faked):
Apples And Oranges
You get if installed:
Apples

~~~

And

~~~

Oranges

You type:
%~~ SEARCH{"GluePlugin"
~~~        nosearch="on" nosummary="on" nototal="on"
~~~        separator=", "
~~~        scope="topic"
~~~        format="$topic"
~~~ }%
You get (faked):
Glue Plugin
You get if installed:
%~~ SEARCH{"GluePlugin" ~~~ nosearch="on" nosummary="on" nototal="on" ~~~ separator=", " ~~~ scope="topic" ~~~ format="$topic" ~~~ }%

Plugin Settings

  • Set SHORTDESCRIPTION = Enable TWikiML to span multiple lines

Plugin Installation Instructions

  • Download the ZIP file from the Plugin web (see below)
  • Unzip GluePlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/GluePlugin.txt Plugin topic
    lib/TWiki/Plugins/GluePlugin.pm Plugin Perl module
  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.
  • If the plugin is installed correctly then the following two fruits will appear joined on one line: Apples

~~~ and Oranges

Plugin Info

Plugin Author: TWiki:Main.MichaelDaum
Copyright ©: 2005-2006, Michael Daum
License: GPL (GNU General Public License)
Plugin Version: 28 Aug 2005 (V1.5)
Change History:  
28 Aug 2005: changed glue syntax; added glue escape sequence to work arround tags been interpreted before lines are recombined
16 Aug 2005: properly support internal tags; performance improvements; fixed use if uninitialized value
15 Aug 2005: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.024
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: Good Style nn%, Formatted Search nn%, Glue Plugin nn%
Plugin Home: TWiki:Plugins/GluePlugin
Feedback: TWiki:Plugins/GluePluginDev
Appraisal: TWiki:Plugins/GluePluginAppraisal

-- TWiki:Main.MichaelDaum - 15 Aug 2005

 
Ad Sponsor
Back to Redbourn
Copyright © We make no guarantee of the correctness of the content of this site. All material on this collaboration platform is the property of Martin Cleaver and the contributing authors.