[Templates] Creating Wiki-style Free links?
[prev]
[thread]
[next]
[Date index for 2004/09/01]
I'd been meaning to get around to this for a while, and when I finally
did, I realized that I couldn't quite figure out how to do it.
I want TT to process text that has some variety of Wiki-style tag in it,
and turn this into an html link. For example, I could have links in
the style of [[123|Text to appear]], and I want this turned into
<a href="http://www.mysite.com/path/action/123">Text to appear</a>. Or,
if there's no "|" with following text, then the "123" should be the
hot link. There can be any number of such links in the text.
I was originally going to write it as a filter, but realized that I
need to access some TT variables, which determine the path and action,
and it would be clunky to pass every possible variable into the filter.
But I'm not sure how to write it as a TT macro, because it seems like
it would be a difficult with the existing regex-type things in TT.
Thanks for any suggestions.
Jesse Sheidlower
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
[Templates] Creating Wiki-style Free links?
Jesse Sheidlower 13:05 on 01 Sep 2004
|