Changes between Version 4 and Version 5 of TracDev/PluginDevelopment/ExtensionPoints/trac.wiki.api.IWikiMacroProvider
- Timestamp:
- Jul 14, 2012, 9:06:22 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/PluginDevelopment/ExtensionPoints/trac.wiki.api.IWikiMacroProvider
v4 v5 26 26 A further parameter `formatter` provides access to various useful objects: 27 27 * `formatter.resource` (a [source:trunk/trac/resource.py trac.resource.Resource])[[BR]] 28 The resource identifier which owns the text being formatted. (E.g. a wiki page, where `formatter.resource.id` is the page name.) 28 The resource identifier which owns the text being formatted. (E.g. a wiki page, where `formatter.resource.id` is the page name.) In practice, it's used to identify the target URL for relative links present in that Wiki text (e.g. `[#section see Section]`) independently from where the rendered text gets displayed (in the timeline, in a report, etc.) 29 29 * `formatter.perm` (a [source:trunk/trac/perm.py trac.perm.PermissionCache])[[BR]] 30 30 The permission cache which can be used to perform fine-grained permission checks. … … 32 32 The URL builder. 33 33 * `formatter.wiki` (a [source:trunk/trac/wiki/api.py trac.wiki.api.WikiSystem])[[BR]] 34 The wiki system can be used to access wiki pages .34 The wiki system can be used to access wiki pages, settings and helper functions (e.g. `format_page_name()`). 35 35 * `formatter.wikiparser` (a [source:trunk/trac/wiki/parser.py trac.wiki.parser.WikiParser])[[BR]] 36 The wiki parser .36 The wiki parser (for now, only the constants used to form the standard regexps are there; the full "parser" is still in formatter.py for historical reasons) 37 37 * `formatter.context` (a [source:trunk/trac/mimeview/api.py trac.mimeview.api.RenderingContext])[[BR]] 38 The rendering context in which this wiki formatting takes place. 38 The rendering context in which this wiki formatting takes place. Use this rather than the `.req` to retrieve information about the author, the permissions and the like. 39 39 * `formatter.req` (a [source:trunk/trac/web/api.py trac.web.api.Request])[[BR]] 40 40 The web request. (to be deprecated) … … 136 136 * Related to the [[trac.wiki.api.IWikiSyntaxProvider]] 137 137 * Related tickets: 138 * [query: status=!closed&component=wiki+systemwiki system component]138 * [query:"status=!closed&component=wiki system" wiki system component] 139 139 * [query:?status=!closed&keywords=~macro macro keywords] 140 140 * #10038 Translated macro descriptions