r8 - 14 Feb 2005 - 19:52:46 - WillNorrisYou are here: TWiki >  Plugins Web > PseudoXmlPlugin
Tags:
css 1 Add my vote for this tag, xml 1 Add my vote for this tag, , create new tag

PseudoXmlPlugin

This plugin allows the user to type just any tag, and have the twiki engine convert it to span employing the pseudo-tag as the span's class or id

Syntax Rules

<date>11 Oct 2003</date> would be renamed: <span class="date">11 Oct 2003</span>

  • psuedo-tags are numbers, upper and lowercase letters, hyphen (-), and the underscore (_) only
  • does not support tag properties (e.g,. id="name", width="320", etc.)
  • no extra spaces around the angle brackets

<#id>11 Oct 2003</id> would be renamed: <span id="date">11 Oct 2003</span>

Examples

<style>
.wiki      { background:green; color:white; }
.author    { background:%<nop>WEBBGCOLOR%; color:white; }
.bad       { background:red; }
.tags      { background:red; }
</style>
<wiki>Project Wiki</wiki> Project Wiki
<author>Steven Brust</author> Steven Brust
<wiki>wiki<author>author</author> more wiki</wiki> wikiauthor more wiki
<bad>bad tags</tags> bad tags

feel free to improve the examples by editing TWiki:Plugins/PseudoXmlPlugin

Caveats

  • Nested tags are now expanded, but I think I might have significantly impacted the performance frown
  • Multiline tags aren't handled correctly

PseudoXmlPlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %PSEUDOXMLPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = renders xml-like tags as span with class or id of the pseudo-tag

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip PseudoXmlPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/PseudoXmlPlugin.txt Plugin topic
    lib/TWiki/Plugins/PseudoXmlPlugin.pm Plugin Perl module
    data/Sandbox/TestTopicPseudoXmlPlugin.txt Plugin topic test
  • Test if the installation was successful:
<wiki>Project Wiki</wiki> Project Wiki
<author>Dr. Seuss</author> Dr. Seuss
    • see also also TestTopicPseudoXmlPluginNoSubstitutions? , TestTopicPseudoXmlPluginHalfSubstitutions? , TestTopicPseudoXmlPluginAllSubstitutions? , TestTopicPseudoXmlPluginNestedSubstitutions?

Plugin Info

Plugin Author: TWiki:Main/WillNorris
Plugin Version: 12 Oct 2003 (V1.000)
Change History:  
12 Oct 2003: Initial version
14 Oct 2003: v1.001 - handles nested tags (but still not multiline tags)
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/PseudoXmlPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/PseudoXmlPluginDev

Related Topics: TWikiPreferences, TWikiPlugins

-- TWiki:Main/WillNorris - 12 Oct 2003

Topic attachments
I Attachment Action Size Date Who Comment
zipzip PseudoXmlPlugin.zip manage 6.7 K 16 Oct 2003 - 07:59 WillNorris  
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r8 < r7 < r6 < r5 < r4 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo