Edgewall Software

Changes between Version 4 and Version 5 of TracDev/PluginDevelopment/ExtensionPoints/trac.wiki.api.IWikiMacroProvider


Ignore:
Timestamp:
Jul 14, 2012, 9:06:22 PM (12 years ago)
Author:
Peter Suter
Comment:

Copied some improvements from wiki:trac.wiki.api.IWikiSyntaxProvider@2

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/PluginDevelopment/ExtensionPoints/trac.wiki.api.IWikiMacroProvider

    v4 v5  
    2626A further parameter `formatter` provides access to various useful objects:
    2727 * `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.)
    2929 * `formatter.perm` (a [source:trunk/trac/perm.py trac.perm.PermissionCache])[[BR]]
    3030   The permission cache which can be used to perform fine-grained permission checks.
     
    3232   The URL builder.
    3333 * `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()`).
    3535 * `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)
    3737 * `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.
    3939 * `formatter.req` (a [source:trunk/trac/web/api.py trac.web.api.Request])[[BR]]
    4040   The web request. (to be deprecated)
     
    136136 * Related to the [[trac.wiki.api.IWikiSyntaxProvider]]
    137137 * Related tickets:
    138   * [query:status=!closed&component=wiki+system wiki system component]
     138  * [query:"status=!closed&component=wiki system" wiki system component]
    139139  * [query:?status=!closed&keywords=~macro macro keywords]
    140140  * #10038 Translated macro descriptions