Edgewall Software

source: tags/trac-0.11/wiki-macros/README

Last change on this file was 6324, checked in by Christian Boos, 16 years ago

Standardize all text files on native eol-style. Fixes #5576

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1Support for HDF-based macros has been dropped starting with Trac 0.11
2as with the switch to the Genshi templating engine, the `hdf` data
3prepared for the Clearsilver engine used upto Trac 0.10 has simply
4disappeared.
5
6This means that the old-style macros installed in the `wiki-macros` folder,
7i.e. the Python source files containing the simple function:
8
9 def execute(hdf, txt, env):
10 ...
11
12must be rewritten into new-style macros,
13i.e. plugins implementing the IWikiMacroProvider interface.
14
15This is not necessarily a complex task, given that:
16 - the plugin can be a "single file plugin" which doesn't need to be
17 configured to use setuptools. Creating a single .py source file
18 and dropping it at the right place (the `plugins` folder next to
19 the old `wiki-macros` folder) also works;
20 - instead of implementing the IWikiMacroProvider directly,
21 inheriting from the WikiMacroBase class also works well and is
22 a bit more convenient.
23
24Note that not only is this not more complex, but it's also much more
25powerful, as the macro can now access the Wiki `formatter` object,
26and through it, all the other objects that are meaningful in the
27context of the Wiki text containing the macro call.
28
29You can see how the examples for the old-style macros have been
30converted to the new-style macros (single file plugins), in the
31`sample-plugins/HelloWorld.py` and `sample-plugins/Timestamp.py` files.
32
33Note that the TracGuideToc macro has been integrated in the main
34source code base (in `trac/wiki/macros.py`).
Note: See TracBrowser for help on using the repository browser.