Edgewall Software

Changes between Version 9 and Version 10 of TracDev/PluginDevelopment


Ignore:
Timestamp:
Oct 13, 2005, 5:47:38 PM (15 years ago)
Author:
Christopher Lenz
Comment:

Update way to enable/disable components

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/PluginDevelopment

    v9 v10  
    9494}}}
    9595
    96 You can omit the `--install-dir` argument to make the development version of your plugin available globally. 
     96You can omit the `--install-dir` argument to make the development version of your plugin available globally.
    9797
    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.
     98This 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.
    9999
    100 A tutorial to build your own plugins is available here: http://trac-hacks.swapoff.org/wiki/EggCookingTutorial
     100A tutorial to build your own plugins is available [http://trac-hacks.swapoff.org/wiki/EggCookingTutorial here].
    101101
    102102== Disabling built-in components ==
    103103
    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.
     104Sometimes 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.
    105105
    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.
     106You 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.
    107107
    108 For example, to disable the built-in Wiki macro {{{RecentChanges}}}, you'd include the following in {{{trac.ini}}}:
     108For example, to disable the built-in Wiki macro `RecentChanges`, you'd include the following in [wiki:TracIni trac.ini]:
    109109{{{
    110 [disabled_components]
    111 trac.wiki.macros.RecentChanges = yes
     110[components]
     111trac.wiki.macros.RecentChanges = disabled
    112112}}}
    113113
    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):
     114You 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):
    115115{{{
    116 [disabled_components]
    117 trac.wiki = yes
     116[components]
     117trac.wiki.* = disabled
    118118}}}
    119119
    120120----
    121 See also: TracDev, TracDev/ComponentArchitecture
     121See also: TracDev, TracDev/ComponentArchitecture, TracPlugins