Rendering variables or tiddlers within commented text
43 views
Skip to first unread message
Fidel N
unread,
Dec 5, 2016, 1:46:58 PM12/5/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to TiddlyWiki
Hey all:
Is there a way to render a variable (or the content of another tiddler) within commented text?
For instance, say our variable <<my_variable>> contains the value "apple":
Is there any way to make the following tw text:
``` This is my text <<my_variable>> ```
Render as:
Thisismy text apple
Thanks!
Mark S.
unread,
Dec 5, 2016, 2:54:45 PM12/5/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to TiddlyWiki
The whole point of the comment text is to show the literal value of the following text. But you can interpolate into the text if you move the actual text into a macro and then pass the terms you want as arguments. Here is an example:
\define mytext(word1 word2) ``` This is my template that features the word: $word1$ and the word $word2$. Aren't they great? ``` \end
<<mytext chicken cat>>
HTH Mark
Fidel N
unread,
Dec 5, 2016, 3:15:44 PM12/5/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to TiddlyWiki
Awesome, thanks!! Yes I understand hehe, but the purpose is to be able to generate dynamic code, so when you define some tiddler values, it will render with the values for a specific setup, but still commented as code.