Hi Bob

The simplest way to do this is to define a macro:

\define manLink(title)
[[$title$|http://manpages.debian.org/cgi-bin/man.cgi?query=$title$]]
\end

The dollar syntax is used within a macro definition to perform textual
substitution of a macro parameter value. The substitutions are performed
before the content of the macro are parsed and rendered, which allows you
to use substitution to build up bits of wikitext syntax.

You'd call it like this:

<<manLink "apt-get">>

We can build a second macro that links to the current tiddler like this:

\define manLinkCurrentTiddler()
<<manLink "$(currentTiddler)$">>
\end

The $()$ syntax performs textual substitution of a variable value. The
variable "currentTiddler" contains the title of the current tiddler.

It would be called like this:

<<manLinkCurrentTiddler>>

You can make both macros into global macros by placing the two definitions
in a tiddler and tagging it $:/tags/Macro.

Best wishes

Jeremy.


On Sat, Oct 25, 2014 at 2:23 PM, Bob Garner <bobg...@gmail.com> wrote:

> Hi,
>
> I've been working with TiddlyWiki for only a short time, and have setup a
> button to open a new tiddler from a skeleton tiddler, within the new
> tiddler content I want to have a few links automatically add the title of
> the tiddler to them
>
> i.e. if I make a tiddler for a bash command, say apt-get, I would like to
> have the link in the content read as
>
>  [[apt-get|http://manpages.debian.org/cgi-bin/man.cgi?query=apt-get]]
>
> I have tried
>  [[{{!!title}}|
> http://manpages.debian.org/cgi-bin/man.cgi?query={{!!title}}]]
> and
>  [[<<currentTitle>>|http://manpages.debian.org/cgi-bin/man.cgi?query=
> <<currentTitle>>]]
>
> I have also tried both <<currentTitle>> and {{!!title}} within a standard
> <a href type html link but nothing works
>
> I have looked into the linkwidget but that info has just made my brain
> freeze up lol
>
> I hope somebody could point out where my thinking is going wrong and how
> to achieve this
>
> Many thanks
> Bob
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tiddlywiki+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> Visit this group at http://groups.google.com/group/tiddlywiki.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeremy Ruston
mailto:jeremy.rus...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to