Subject: | Feature request: Macro support |
To go along with my previous feature request for TracLinks, it'd also
be nice to have the ability to create WikiMacros to plug in to
Text::Trac.
Here's my initial thoughts...
---
Using the list of Wiki Macros provided by Trac as an example, I could
see the classes structure themselves like:
Text::Trac::Macro::Timestamp
Text::Trac::Macro::HelloWorld
Text::Trac::Macro::TicketQuery
Text::Trac::Macro::TitleIndex
...
Each macro package would contain a single function in it, "execute()",
which would accept all of the args that were parsed out of the macro
call in the Wiki text.
E.g.
package Text::Trac::Macro::Timestamp;
sub execute {
return scalar localtime();
}
or
package Text::Trac::Macro::HelloWorld;
sub execute {
return 'Hello World, args = ' . @_;
}
---
Thoughts??