TWiki
>
TWiki Web
>
GluePlugin
(23 Oct 2019,
TWikiAdminUser
)
(raw view)
---+!! <nop>%TOPIC% <!-- Contributions to this plugin are appreciated. Please update the plugin page at http://twiki.org/cgi-bin/view/Plugins/GluePlugin or provide feedback at http://twiki.org/cgi-bin/view/Plugins/GluePluginDev. If you are a TWiki contributor please update the plugin in the SVN repository. --> %SHORTDESCRIPTION% <div style="float:right; background-color:#eeeeee; margin:0 0 20px 20px; padding: 0 10px 0 10px; width:380px"> %TOC% </div> ---++ Description This plugin will help you to write _readable_ markup (<nop>TWikiMarkup, HMTL, ...) within TWiki 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 ways of glueing and recombining lines by either removing all whitespaces between two lines using =%*~~= or by removing all whitespaces and separateing lines with a single space using =%~~~=. There's a helper character sequence =%~~= that prevents the TWiki engine to interprete tags before the GluePlugin could reformat the text. In addition there's a glue sequence =#~~= to insert comments within a <nop>TWikiMarkup expression. While these glue sequences might feel strange at the beginning they help you to format and recognize your markup and make it more readable. That way you will be able to format a <nop>TWikiApplications that looked like this <verbatim> %SEARCH{"..." type="query" header="<table width="100%" border="5px"><thead><tr><th>Name</th><th>Description</th><th>Date</th></tr></thead>" format="<tr><th>$formfield(Name)</th><th>$summary</th><th>$createdate</th></tr>" footer="</table>"}% </verbatim> somewhat like this <verbatim> #~~ ################################# #~~ # This is my new TWikiApplication ~~~ %~~ SEARCH{ #~~ ################################# #~~ # this is the search expression ~~~ "..." ~~~ ~~~ type="query" ~~~ #~~ ################################# #~~ # this is the header of the result table ~~~ ~~~ header=" ~~~ <table ~~~ width="100%" ~~~ border="5px" ~~~ > ~~~ <thead> ~~~ <tr> ~~~ <th>Name</th> ~~~ <th>Description</th> ~~~ <th>Date</th> ~~~ </tr> ~~~ </thead>" #~~ ################################# #~~ # every row will be formatted like this ~~~ ~~~ format=" ~~~ <tr> ~~~ <th>$formfield(Name)</th> ~~~ <th>$summary</th> ~~~ <th>$createdate</th> ~~~ </tr>" #~~ ################################# #~~ # and finally we close this html table ~~~ ~~~ footer="</table>" ~~~ }% #~~ ################################# #~~ # sure we could have used #~~ # | TWikiTables | as well | #~~ # but these aren't robust against newlines #~~ # in the $summary field #~~ ################################# </verbatim> ---++ 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 | | =#~~<space>= | comment line, all chars on the same line are removed | 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 GluePlugin is exemplified by <verbatim> %~~ TAG{ ~~~ key=" *~~ hello ~~~ world *~~ " ~~~ }% </verbatim> which will be recombined to <verbatim> %<nop>TAG{ key="hello world" }% </verbatim> ---++ Examples <table class="twikiTable"> <tr><th> You type: </th></tr> <tr><td> <verbatim> This is a line ~~~ glued to another line. </verbatim> </td></tr> <tr><th> You get (faked): </th></tr> <tr><td> <pre> This is a line glued to another line. </pre> </td></tr> <tr><th> You get if installed: </th></tr> <tr><td> <pre> This is a line ~~~ glued to another line. </pre> </td></tr> </table> <table class="twikiTable"> <tr><th>You type:</th></tr> <tr><td> <verbatim> Glue *~~ Plugin </verbatim> </td></tr> <tr><th>You get (faked):</th></tr> <tr><td> GluePlugin </td></tr> <tr><th>You get if installed:</th></tr> <tr><td> Glue *~~ Plugin </td></tr> </table> <table class="twikiTable"> <tr><th>You type:</th></tr> <tr><td> <verbatim> Apples ~~~ And ~~~ Oranges </verbatim> </td></tr> <tr><th>You get (faked):</th></tr> <tr><td> Apples And Oranges </td></tr> <tr><th>You get if installed:</th></tr> <tr><td> Apples ~~~ And ~~~ Oranges </td></tr> </table> <table class="twikiTable"> <tr><th>You type:</th></tr> <tr><td> <verbatim> %~~ SEARCH{"GluePlugin" ~~~ nosearch="on" nosummary="on" nototal="on" ~~~ separator=", " ~~~ scope="topic" ~~~ format="$topic" ~~~ }% </verbatim> </td></tr> <tr><th>You get (faked):</th></tr> <tr><td> %SEARCH{"GluePlugin" nosearch="on" nosummary="on" nototal="on" separator=", " scope="topic" format="$topic"}% </td></tr> <tr><th>You get if installed:</th></tr> <tr><td> %~~ SEARCH{"GluePlugin" ~~~ nosearch="on" nosummary="on" nototal="on" ~~~ separator=", " ~~~ scope="topic" ~~~ format="$topic" ~~~ }% </td></tr> </table> <style type="text/css"> .twikiTable { width:100%; } .twikiTable th { text-align:left; } .twikiTable pre { margin:0px; } </style> ---++ Plugin Installation Instructions * Download the ZIP file from twiki.org (see below) * Unzip it in your twiki installation directory. Content: | *File:* | *Description:* | | ==data/TWiki/GluePlugin.txt== | | | ==lib/TWiki/Plugins/GluePlugin.pm== | | * Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section. * Set the plugins evaluation order to put the GluePlugin in first position, e.g. <verbatim>$TWiki::cfg{PluginsOrder} = 'GluePlugin,IfDefinedPlugin,SpreadSheetPlugin';</verbatim> * If the plugin is installed correctly then the following two fruits will appear joined on one line: Apples ~~~ and Oranges ---++ Plugin Info <!-- provided for compatibility only * Set SHORTDESCRIPTION = Enable TML (TWiki Markup Language) to span multiple lines --> | Plugin Author: | TWiki:Main.MichaelDaum | | Copyright: | © 2005-2007, Michael Daum http://michaeldaumconsulting.com <br /> © 2004-2010, TWiki:TWiki/TWikiContributor | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | | Plugin Version: | v2.1 | | Change History: | <!-- versions below in reverse order --> | | 2010-04-30: | TWikibug:Item6433 - doc improvements | | 23 Nov 2007: | added way to add comments in the middle of a <nop>TWikiMarkup expression | | 31 Aug 2006: | added NO_PREFS_IN_TOPIC | | 28 Jul 2006: | fixed MANIFEST;\ some minor docu updates; \ added =use strict;= | | 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: | %SYSTEMWEB%.GoodStyle nn%, %SYSTEMWEB%.FormattedSearch nn%, %TOPIC% nn% | | Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% | | Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev | | Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal | __Related Topics:__ %SYSTEMWEB%.TWikiPlugins, %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.TWikiPreferences
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r3 - 23 Oct 2019
-
TWikiAdminUser
Home
Site map
JUNOProjectTemplateWeb web
TWiki web
TWiki Web
User registration
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
QuerySearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
InterWikis
ManagingUsers
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Account
Log In
Register User
Български
Cesky
Dansk
Deutsch
English
Español
_Français_
Italiano
日本語
한글
Nederlands
Polski
Português
Русский
Svenska
简体中文
簡體中文
E
dit
A
ttach
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback
Note:
Please contribute updates to this topic on TWiki.org at
TWiki:TWiki.GluePlugin
.