= 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 = {{{ #!python 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 [report:9?COMPONENT=ExtractUrlPlugin here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=ExtractUrlPlugin&owner=martin_s new ticket]. == Download == Download the zipped source from [download:extracturlplugin here]. == Source == You can check out ExtractUrlPlugin from [http://trac-hacks.org/svn/extracturlplugin here] using Subversion, or [source:extracturlplugin browse the source] with Trac. == Example == {{{ #!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) }}} == Recent Changes == [[ChangeLog(extracturlplugin, 3)]] == Author/Contributors == '''Author:''' [wiki:martin_s] [[BR]] '''Contributors:'''