|Version 1 (modified by 8 years ago) (diff),|
Plug-in to extract URL from TracWiki links in Plug-ins and Macros
This plug-in provides the function
extract_url which can be used in Trac plug-ins and macros to extract th URL of any TracWiki link for e.g. generation of links in produced HTML code.
from tracextracturl import extract_url # ... url = extract_url (env, context, wikilink, raw=False)
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.
If you have any issues, create a new ticket.
Download the zipped source from [download:extracturlplugin here].
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)
- 16394 by rjollos on 2017-03-25 09:20:58
- 15264 by rjollos on 2016-02-11 04:22:34
Remove unnecessary svn:mime-type on py files
svn:mime-type was set to "plain" for many files.
- 8545 by martin_s on 2010-08-30 21:57:33
Added encoding meta-comment and declared SVN keywords as unicode to avoid issues with non-english locales.