Hi Joe

One hint that might help is to understand that the various brackets and quotes 
we use as attribute values are treated as special types of quotes, and not as 
operators, as you might expect. That's why you can't nest them.

So, <a href={{mylink}}>Click</a> will use the value of the tiddler "mylink” as 
the value for the attribute "href".

And <a href=<<myvar>>>Click</a> will use the value of the variable "myvar” as 
the value for the attribute “href”.

You can also use triple curly braces to evaluate an attribute value as a filter 
expression, and return the first entry in the result list. For example, to 
retrieve the value of a variable and add a suffix to it:

<a href={{{ [<myvar>addsuffix[.com]] }}}>Click</a>

Best wishes

Jeremy

--
Jeremy Ruston
jer...@jermolene.com
https://jermolene.com

> On 10 Mar 2018, at 23:50, Joe Armstrong <joea...@gmail.com> wrote:
> 
> 
> 
>> On Saturday, 10 March 2018 14:00:30 UTC-8, Mat wrote:
>>> On Saturday, March 10, 2018 at 7:29:47 PM UTC+1, Joe Armstrong wrote:
>> 
>>> I have a pretty good idea how to debug almost any language by writing 
>>> functions calling the code
>>> 
>>> and adding  print statements to the code. But I'm unclear as to how I would 
>>> do this in TW.
>>> 
>> 
>> Well, as far as I understand, TW works on a few layers that can go wrong 
>> depending on what you do. There's the backend JS that is supposed to be 
>> hidden, there are the widgets as a functional layer with fundamental 
>> building blocks, the macros are merely text-substitutions not actual 
>> functions. But wikitext also allow for direct use of html-elements and CSS.
>> 
>> The browser inspector is probably the only real *tool* that you can use to 
>> investigate things.
>> 
>> I think the RSOE (Red Screen of Embarrassment) exclusively is for JS and it 
>> usually gives a clue to what is wrong. There are a few build in error codes 
>> that I believe are for wikitext - I'm primarily thinking of when a bracket 
>> is missing in filters.
>> 
>> BTW, you may find my SideEditor of use. I use it all the time for testing 
>> stuff. It has similarities with the editor preview function.
>> 
>> 
>>> I wanted to take a few tiddlers i don't understand and add a few print 
>>> statement to clarify 
>>> 
>>> what is happening - is this possible?
>>> 
>> 
>> ... it depends ... ;-) 
>> 
>> 
>>> If I take a maco I think what happens is that it returns some text which is 
>>> 
>>> then rescanned - it would be nice to a get a trace of what get called and 
>>> what the
>>> 
>>> return values are (same for widgets and JS code)
>>> 
>> 
>> Macros are pure text substitution. I'm not sure what you mean with 
>> "rescanned".
>> 
>> You can check global variables with this syntax "$(variable)$".
>> 
>> If you give us your actual wikitext code it would be much easier to help you.
> 
> Ok - I want to make a numbered list of tiddlers with tag post
> 
> Version 1)
> 
> <$list filter="[tag[post]]">
> <<currentTiddler>>
> </$list>
> 
> This resulted in
> 
> Building a story line Changing how we think How this blog was created How to 
> create a new blog entry One idea per tiddlerThe Web Is Broken Uplifting 
> Projects What would you like to hear about?
> 
> So far so good
> 
> Vsn 2:
> 
> <ol>
> <$list filter="[tag[post]]">
> <li><<currentTiddler>></li>
> </$list>
> </ol>
> 
> Output 
> Building a story line
> Changing how we think
> How this blog was created
> How to create a new blog entry
> One idea per tiddler
> The Web Is Broken
> Uplifting Projects
> What would you like to hear about?
> Almost right at this point I thought this would work:
> 
> vsn4 
> <ol>
> <$list filter="[tag[post]]">
> <li>[[<<currentTiddler>>]]</li>
> </$list>
> </ol>
> 
> But this results in
> <<currentTiddler>>
> <<currentTiddler>>
> <<currentTiddler>>
> <<currentTiddler>>
> <<currentTiddler>>
> <<currentTiddler>>
> <<currentTiddler>>
> <<currentTiddler>>
> So <<currentTiddler>> is not expanded *inside* [[ .. ]]
>  
> Hang on [[Link]] is expanded into a link and <<....>> is expanded
> so what are the precedence rules?
> 
> Finally 
> <ol>
> <$list filter="[tag[post]]">
> <li>
> <$link>
> <<currentTiddler>>
> </$link>
> </li>
> </$list>
> </ol>
> 
> This worked
> Building a story line
> Changing how we think
> How this blog was created
> How to create a new blog entry
> One idea per tiddler
> The Web Is Broken
> Uplifting Projects
> What would you like to hear about?
> Now I'll have to make this into a macro
> 
> :-)
> 
> /Joe
> 
> 
>  
>> 
>> <:-)
>> 
> 
> -- 
> 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 https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/0efa1415-d3cb-4507-8f33-d9f940bff0cb%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/E934AF74-1946-4280-B934-04AE1A77EC4B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to