Changes between Version 9 and Version 10 of TracDev/PluginDevelopment
- Timestamp:
- Oct 13, 2005, 5:47:38 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/PluginDevelopment
v9 v10 94 94 }}} 95 95 96 You can omit the `--install-dir` argument to make the development version of your plugin available globally. 96 You can omit the `--install-dir` argument to make the development version of your plugin available globally. 97 97 98 This will install an `.egg-link` file instead of the actual egg. That file is basically a link to the source directory of your plugin, so that Trac will always see the latest version of your code. 98 This will install an `.egg-link` file instead of the actual egg. That file is basically a link to the source directory of your plugin, so that Trac will always see the latest version of your code. In this case you will have to explicitly enable your plugin in the trac configuration as explained on TracPlugins. 99 99 100 A tutorial to build your own plugins is available here: http://trac-hacks.swapoff.org/wiki/EggCookingTutorial100 A tutorial to build your own plugins is available [http://trac-hacks.swapoff.org/wiki/EggCookingTutorial here]. 101 101 102 102 == Disabling built-in components == 103 103 104 Sometimes you might want to write a plugin that completely replaces a built-in component, for example to develop an advanced variant of an existing module. Trac uses a list of default component to load, as specified in the {{{default_components}}}list in [source:/trunk/trac/db_default.py#latest trac.db_default]. These built-in components are always loaded, and might therefore conflict with your replacement plugin.104 Sometimes you might want to write a plugin that completely replaces a built-in component, for example to develop an advanced variant of an existing module. Trac uses a list of default component to load, as specified in the `default_components` list in [source:/trunk/trac/db_default.py#latest trac.db_default]. These built-in components are always loaded, and might therefore conflict with your replacement plugin. 105 105 106 You can however disable built-in components using a special [wiki:TracIni trac.ini] section called {{{[disabled_components]}}}. This section contains the qualified name of the components to disable, along with a boolean value (yes/true/1 or no/false/0), where a positive value means the component is disabled, and a negative value means its enabled.106 You can however disable built-in components using a special [wiki:TracIni trac.ini] section called `[disabled_components]`. This section contains the qualified name of the components to disable, along with `disabled` or `off` as the value. 107 107 108 For example, to disable the built-in Wiki macro {{{RecentChanges}}}, you'd include the following in {{{trac.ini}}}:108 For example, to disable the built-in Wiki macro `RecentChanges`, you'd include the following in [wiki:TracIni trac.ini]: 109 109 {{{ 110 [ disabled_components]111 trac.wiki.macros.RecentChanges = yes110 [components] 111 trac.wiki.macros.RecentChanges = disabled 112 112 }}} 113 113 114 This mechanism uses string prefix matching, so you could even disable the complete Wiki module (although wiki formatting will still work in the remaining modules, of course):114 You can also use a wildcard at the end of a name, so you could even disable the complete Wiki module (although wiki formatting will still work in the remaining modules, of course): 115 115 {{{ 116 [ disabled_components]117 trac.wiki = yes116 [components] 117 trac.wiki.* = disabled 118 118 }}} 119 119 120 120 ---- 121 See also: TracDev, TracDev/ComponentArchitecture 121 See also: TracDev, TracDev/ComponentArchitecture, TracPlugins