Hello,
Good timing, I was about to do some more changes in this area...
Christopher Lenz wrote:
Am 16.01.2007 um 21:20 schrieb Emmanuel Blot:
As a plugin, you can just extend WikiMacroBase. You can also use a
single .py file in the plugins/ folder if you want something easier
than a full setuptools plugin.
It seems that the old way to write macro has been discarded (at least,
the macro located in the wiki-macros/ directory does not seem to be
rendered anymore). I should say that I'm a bit confused at this point:
is the "old way" already obsoleted ?
Yes. This is an (mostly unforeseen) side-effect of the move to
Genshi: the old way of writing macros relied heavily on the HDF
object being available, thereby coupling old-style macros tightly to
ClearSilver. As a result, supporting old-style macros would require
some pretty heavy surgery.
It's unfortunate that we did not notice this earlier, as ideally we
should've had an official deprecation phase for old-style wiki macro
API, while providing the new plugin APIs (wiki context etc) to use in
its place. But it's too late at this point. We'll just have to write
a good migration guide and cut off the legacy.
Right, there's already a ticket that can be used to track this
documentation task:
See http://trac.edgewall.org/ticket/2260
A few bits of documentation are already available:
See http://trac.edgewall.org/wiki/TracDev/ApiChanges/0.11#InterfaceChanges
I also like to redirect people on the MacroBazaar page, which has
already been updated to mention the switch and tells how to install new
style macros. In addition, the AutoNav macro listed there comes in 3
flavors: 0.9, 0.10 and 0.11, the last two could be used as samples for
new-style macros (i.e. single file plugin).
See http://trac.edgewall.org/wiki/MacroBazaar#AutoNav
For example, the Timestamp macro that is demonstrated in the
WikiMacros default page does not seem to be found. This is weird as
the trunk still contains the macro in wiki-macros/ dir, and the
wiki-default/WikiMacros page still contains a reference to this macro.
Indeed, there's quite a bit of work pending in this area. Porting the
builtin old-style macros is one of the tasks. Updating the
documentation would be another. IIUC, the cboos' wiki context work
has progressed nicely, so we can actually start with these tasks(?)
The TracGuideToc macro has already been ported (it's now in
trac/wiki/macros.py, so it's always available), and for the other old
macros (which were merely examples), I plan to port them in a new
'/sample-plugins' toplevel folder. That folder could contain a few
"single file" plugins of general interest but not installed by default,
a bit similar to the /contrib area.
The old wiki-macros directory would contain a README explaining the
change and redirecting to the appropriate docs.
-- Christian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---