%META:TOPICINFO{author="TravisBarker" date="1111312615" format="1.0" version="1.13"}%
---++ NOTE: This topic can be dangerous so I restrict edit access below, if you would like to request a macro be set, just ask.
* Set ALLOWTOPICCHANGE = TravisBarker
---++ Macro Plugin
This plugin allows you to create Aliases/Macro's for already existing topics.
It will be easier then to link to a topic because you don't have
to write the full path.
If you write down a %TWIKIWEB%.WikiWord which is registered as a macro, it will then be replaced by its macro.
Non WikiWord may optionally be used as macros.
A macro must be prefixed by one of:
* A white space character
* One of: - = * # & , ; . : / ( ) ] { } + _ >
Note especially, a macro can not be prefixed by: <[
Configuration of this plugin is done by writing your macroes.
If you want to prevent a macro from becoming a link you can use the
=<nop>= tag
---++ Examples
* Just type 'MySelf' and it will become 'Main.MyFullUsername' as seen in normal view if defined as a macro
---++ %TOPIC% Global Settings
* Set SHORTDESCRIPTION = Define macroes which will automatically replace terms
* Debug:
See output in =data/debug.txt=
0 ~ No debug
1 ~ Normal debug
2 ~ Detailed debug
* Set DEBUG = 0
* Allow non TWiki words to become links
* Set ACCEPT_NON_TWIKI_WORD_MACROES = 1
* Put your global aliases in this table:
| *the macro* | *the replacement* |
| fooo | some string bar |
| testtest | test |
---++ Plugin Installation Instructions
old test for AliasPlugin carried over to MacroPlugin below:
* Developers test:
* -fooo =fooo= *fooo* #fooo&fooo,fooo×fooo.fooo:fooo/fooo(fooo)fooo{fooo}fooo+fooo_fooofooofooo[fooo]
however +fooo alone seems to work fine
testing this strange behavior more fooo+fooo _+fooo =+fooo +fooo_
aHA! its not the + that is causing trouble here but the '_' that follows it :)
testing that theory ...
fooo (constant)
fooo_ ( '_' follows)
+fooo_ ( '+' before and '_' after)
Conclusion: macros and aliases cannot be followed by '_' is this known/expected behavior?
---++ Plugin Info
| Plugin Author: | TWiki:Main/OthelloMaurer |
| Plugin Version: | 20 Mar 2005 |
| Change History: | |
| 20 MAR 2005 | Changed to Macros: nolonger links but now replaces.
TWiki:Main.TravisBarker |
| 1 Dec 2003: | No WikiWord aliases as an option More alias prefixes allowed
TWiki:Main.NielsKoldso |
| 16 Oct 2003: | Speedup |
| 09 Oct 2003: | Initial Version |
| CPAN Dependencies: | none |
| Other Dependencies: | none |
| Perl Version: | 5.005 |
| Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
| Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
__Related Topics:__ %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiPlugins, %TWIKIWEB%.AliasPlugin, %TWIKIWEB%.MacrosPlugin
-- TWiki:Main/OthelloMaurer - 09 Oct 2003
-- Main.TravisBarker - 20 Mar 2005