How about an interface like this?
<<ext-link "My Label">> <!-- defaults to field named "url" -->
<<ext-link "Another label" location>> <!-- but you can override it with another field name -->
If that would do, then we could write it like this:
\procedure ext-link(label, field:"url")
<a
class=“tc-tiddlylink-external”
href={{{ [<currentTiddler>get<field>] }}}
target=“_blank”
rel=“noopener noreferrer”
><<label>></a>
\end
We could easily add another optional parameter for the tiddler to query, defaulting to <<currentTiddler>>.
This solution is not a panacea. It only works on a field name. That may be enough. But if you want to be able to pass an arbitrary value, it’s fine, but won’t work with a short-form procedure call, which only accept string parameters. (That’s why your #4 fails.) I’d love to see this in embedded syntax, and not a procedure/macro call. That is, it would be great if your #1 or #2 could be made to work. I don’t know how difficult that would be, or even if it’s fundamentally impossible. #3 won’t work for the simple reason that the $link widget is designed for internal links. I think this manages to do #5, except using a procedure rather than a macro.




