Plug-in to extract URL from TracWiki links in Plug-ins and Macros

Description

This plug-in provides the function extract_url which can be used in Trac plug-ins and macros to extract the URL of any TracWiki link for e.g. generation of links in produced HTML code.

Usage

from tracextracturl import extract_url
# ...
  url = extract_url (env, context, wikilink, raw=False)

The argument raw controls if the returned link should point to a brows-able (False) or download-able (True) target. The second one can be used in image or similar tags.

Bugs/Feature Requests

Existing bugs and feature requests for ExtractUrlPlugin are here.

If you have any issues, create a new ticket.

Download and Source

Download the zipped source, check out here using Subversion, or browse the source with Trac.

Example

from tracextracturl import extract_url

def MyMacro(WikiMacroBase):
  def expand_macro (self, formatter, name, content):
     # e.g. wikilink = 'wiki:WikiStart'
     url = extract_url(self.env, formatter.context, wikilink)

Recent Changes

[8545] by martin_s on 08/30/10 23:57:33

Added encoding meta-comment and declared SVN keywords as unicode to avoid issues with non-english locales.

[8420] by martin_s on 08/23/10 13:11:33

Removed outdated variable rev from setup file.

[8393] by martin_s on 08/20/10 15:23:30

Removed import of source revisions to avoid installation issues.

[7069] by martin_s on 11/05/09 12:35:00

tracextracturl/init.py
Fixed wrong name.

Author/Contributors

Author: martin_s
Maintainer: martin_s
Contributors: