[[PageOutline(2-5,Contents,pullout)]] = Extract URL from Trac wiki links in plugins and macros == Description This plugin provides the function `extract_url`, which can be used in Trac plugins and macros to extract the URL of any TracWiki link, for example generation of links in produced HTML code. The definition of this plugin is as follows: {{{#!python from tracextracturl import extract_url # ... url = extract_url (env, context, wikilink, raw=False) }}} The optional argument `raw` 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: {{{#!python 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) }}} == Bugs/Feature Requests Existing bugs and feature requests for ExtractUrlPlugin are [report:9?COMPONENT=ExtractUrlPlugin here]. If you have any issues, create a [/newticket?component=ExtractUrlPlugin new ticket]. [[TicketQuery(component=ExtractUrlPlugin&group=type,format=progress)]] == Download Download the zipped source from [export:extracturlplugin here]. The plugin is also available on [pypi:TracExtractUrl PyPi]. == Source Check out [/svn/extracturlplugin/0.11 here] using Subversion, or [source:extracturlplugin browse the source] with Trac. == Installation General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. == Recent Changes [[ChangeLog(extracturlplugin, 3)]] == Author/Contributors '''Author:''' [wiki:martin_s] [[BR]] '''Maintainer:''' [[Maintainer]] [[BR]] '''Contributors:'''