diff --git a/data/System/DelayMacroPlugin.txt b/data/System/DelayMacroPlugin.txt index 287bf85..3a52681 100644 --- a/data/System/DelayMacroPlugin.txt +++ b/data/System/DelayMacroPlugin.txt @@ -3,6 +3,8 @@ %SHORTDESCRIPTION% +%ATTACHURL%/delaylogo.png + ---++ Examples This plugin enables the use of a more clear syntax when building applications where you need to delay the expansion of macros inside the format parameter of another macro which supports the tokens $percnt and $quot. The most typical usecase is inside the format of a SEARCH. @@ -32,13 +34,35 @@ The !DelayMacroPlugin can make this syntax much clearer minimizing the need to u Note that we still need to use $dollar to delay the expansion of $topic. The Delay Macro Plugin cannot know if the $topic should belong to the inner or outer loop. In this case we want it to belong to the inner loop and delay it as $dollartopic +Here is an example where we have a nested search and inside the inner loop we want to delay the ENCODE to run after the outer SEARCH is complete + + +%SEARCH{ + "culture" + web="System" + format=" * $topic is referenced by:$n * $percntSEARCH{$quot$topic$quot format=$quot$dollarpercntENCODE{$dollarquot$dollartopic$dollarquot type=$dollarquoturl$dollarquot}$dollarpercnt$quot nonoise=$quoton$quot separator=$quot, $quot }$percnt" + nonoise="on" +}% + + +and the same much simpler and much easier to get to work using this plugin + + +%SEARCH{ + "culture" + web="System" + format=" * $topic is referenced by:$n * %DELAYSEARCH{"$topic" format="%DELAY{macro="ENCODE" delay="2" "$dollartopic" type="url"}%" nonoise="on" separator=", " }%" + nonoise="on" +}% + + ---++ Plugin Use You can delay the expansion of any macro using DELAY The syntax is simple -=%DELAY{macro="MACRONAME" delay="depth" "default param for MACRONAME" param1="blabla" param2="blable"}%= +=%DELAY{macro="MACRONAME" delay="depth" "default param for MACRONAME" param1="blabla" param2="blabla"}%= Ie. You replace the macro name you want to delay by DELAY and put the macro name as the parameter macro. The delay indicates how many times you want to delay the expansion. The default is 1 so if you have a nested SEARCH with a SEARCH within another SEARCH, you can ommit the delay parameter. @@ -75,6 +99,10 @@ If the plugin is installed and works you should see the result of the example ab nonoise="on" }% +---++ Plugin Settings + +The plugin has no settings at all. +   | -| 02 Mar 2010 (1.0) | Initial release | +| 03 Mar 2010 (1.0) | Initial release | | Home: | http://foswiki.org/Extensions/%TOPIC% | | Support: | http://foswiki.org/Support/%TOPIC% | +%META:FILEATTACHMENT{name="delaylogo.png" attachment="delaylogo.png" attr="h" comment="" date="1267605968" path="delaylogo.png" user="ProjectContributor" version="1"}% diff --git a/lib/Foswiki/Plugins/DelayMacroPlugin/MANIFEST b/lib/Foswiki/Plugins/DelayMacroPlugin/MANIFEST index 5c99322..1586569 100644 --- a/lib/Foswiki/Plugins/DelayMacroPlugin/MANIFEST +++ b/lib/Foswiki/Plugins/DelayMacroPlugin/MANIFEST @@ -1,2 +1,3 @@ data/System/DelayMacroPlugin.txt 0644 Plugin doc page lib/Foswiki/Plugins/DelayMacroPlugin.pm 0444 Plugin Perl module +pub/System/DelayMacroPlugin/delaylogo.png 0444 Plugin doc image \ No newline at end of file diff --git a/pub/System/DelayMacroPlugin/delaylogo.png b/pub/System/DelayMacroPlugin/delaylogo.png new file mode 100644 index 0000000..95ea461 Binary files /dev/null and b/pub/System/DelayMacroPlugin/delaylogo.png differ