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
- 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)
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 |
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins
--
TWiki:Main/WillNorris
- 12 Oct 2003