This plugin provides the functionextract_url
, which can be used in Trac plugins and macros to extract theURL of anyTracWiki link, for example generation of links in producedHTML code.
The definition of this plugin is as follows:
fromtracextracturlimport extract_url# ... url= extract_url(env, context, wikilink, raw=False)
The optional argumentraw
controls whether the returned link should point to a brows-able (False) or download-able (True) target. The value True can be used in image or similar tags. False is the default value.
As an example you could have this:
fromtracextracturlimport extract_urldefMyMacro(WikiMacroBase):defexpand_macro(self, formatter, name, content):# e.g. wikilink = 'wiki:WikiStart' url= extract_url(self.env, formatter.context, wikilink)
Existing bugs and feature requests forExtractUrlPlugin arehere.
If you have any issues, create anew ticket.
Download the zipped source fromhere.
The plugin is also available onPyPi.
Check outhere using Subversion, orbrowse the source with Trac.
General instructions on installing Trac plugins can be found on theTracPlugins page.
Author:martin_s
Maintainer:Martin Scharrer
Contributors: