RandomReplacePlugin
Replace ##Tags## with text once, the replaced text is saved in the topic and the tag is removed.
Introduction
This plugin looks for tags in the format of ##TypeOfReplace## and replaces it with the result of that particular tag. Designed to facilitate random features for an RPG TWiki. Once the topic is saved, the substitution happens, and the tag disapears. Rules and associated data are defined in
RandomReplaceRules.
Syntax Rules
Examples
- ##MonthNameExample##
- ##Greetings##
Plugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%, i.e.
%RANDOMREPLACEPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Replace ##Tags## with text once, the replaced text is saved in the topic and the tag is removed.
- Debug plugin: (See output in
data/debug.txt)
- To set the rules topic where rule names and actions are defined. Default to RandomReplaceRules
- To include an HTML comment containing the original rule set REPLACEONCECOMMENT = 1
- Set REPLACEONECOMMENT = 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
RandomReplacePlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/RandomReplacePlugin.txt | Plugin topic |
data/TWiki/RandomReplacePlugin.txt,v | Plugin topic repository |
data/TWiki/RandomReplaceRules.txt | Plugin Rules topic |
data/TWiki/RandomReplaceGoodByes.txt | Example topic containing data |
lib/TWiki/Plugins/RandomReplacePlugin.pm | Plugin Perl module |
pub/TWiki/RandomReplaceRules/month.txt | Example attached text file |
- Test if the installation was successful:
- ##Howdy##
- ##MonthName##
- ##GoodBye##
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins