16 | | 1. Open a Wiki page and add the macro text to test the macro (usually something like {{{[[Macro]]}}} or {{{[[Macro(argument1, argument2)]}}} |
| 16 | 1. Open a Wiki page and add the macro text to test the macro (usually something like `[[Macro]]` or `[[Macro(argument1, argument2)]` |
| 17 | |
| 18 | Note that this kind of macros is still supported in Trac [milestone:0.10], but deprecated. You should start developing and using macros as plugins implementing the `IWikiMacroProvider` interface, or, even simpler, inheriting from the `trac.wiki.macros.WikiMacroBase` class. |
| 19 | |
| 20 | '''Installing a macro ''(new style macros)'' ''' |
| 21 | |
| 22 | This follows the same rules as installing a plugin, see TracPlugins. |
| 23 | |
| 24 | But usually, macros are simple enough so that they can be developed as ''single file plugins''. In that case, the installation is simpler, and much similar to the above: |
| 25 | 1. Download the ''<macro>.py'' file. |
| 26 | 1. Save it to your '''`projenv/plugins`''' directory |
| 27 | 1. Restart your web server |
| 28 | 1. Open a Wiki page and add the macro text to test the macro (usually something like `[[Macro]]` or `[[Macro(argument1, argument2)]` |
| 29 | |
| 30 | Example for such macros are provided below: |
| 31 | - [#AutoNav AutoNav] |
| 32 | - ... |
| 33 | |
| 34 | |
172 | | ''Download:'' [attachment:AutoNav.2.py] |
173 | | [[BR]]''By:'' Anders Jansson <anders dot jansson at kastanj dot net> |
174 | | |
175 | | Fixed a small bug in the page enumeration. |
176 | | ''Download:'' [attachment:AutoNav.3.py] |
177 | | [[BR]]''By:'' anonymous |
178 | | |
179 | | Reimplemented !AutoNav as plugin for upcoming Trac 0.11 (#3958) |
180 | | ''Download'' [attachment:ticket:3958:AutoNavPlugin.tar.bz2 AutoNavPlugin.tar.bz2] |
181 | | [[BR]]''By:'' Andrew Stromnov <stromnov at gmail dot com> |
| 191 | |
| 192 | ''By:'' Anders Jansson <anders dot jansson at kastanj dot net> |
| 193 | |
| 194 | Reimplemented !AutoNav as plugin for upcoming Trac 0.11 (#3958) [[br]] |
| 195 | ''Download:'' [attachment:autonav-trac-0.10.py autonav-trac-0.10.py] [attachment:autonav-trac-0.11.py autonav-trac-0.11.py] [[br]] |
| 196 | ''Installation:'' place in your TracEnvironment, in the `plugins` subfolder. |
| 197 | ''By:'' Andrew Stromnov <stromnov at gmail dot com>, cboos |