Sorry about the missing image, my toddler was trying to get me to play 
Legos as I was replying.

<https://lh3.googleusercontent.com/-aiXhdHW9u1k/WHuaztSPHiI/AAAAAAAAiMY/10-9F6_TZlElJGvgW5UwhPMc3lTod9PowCLcB/s1600/Equation%2BEdit.JPG>

The actual text of the "equation" field in the "reference 
evapotranspiration" tiddler (tagged "Equation") is:
<$latex text="ET_0=ET_{wind}+ET_{rad}=\frac{0.408 \Delta (R_n-G)+\gamma 
(\frac{900}{T+273})u_2(e_s-e_a)}{\Delta+\gamma(1+0.34 u_2)}" 
displayMode="true"></latex>

The actual text of the "variable" field in the "actual vapor pressure" 
tiddler tagged "Variable" is:
e_a

So the code below works to return the equations that reference a variable. 
Since we can do a equation.match(".*?e_a.*?") (javascript format for 
example) type regex search. However, it doesn't work the other way, because 
if we do a variable.match(".*?<$latex 
text="ET_0=ET_{wind}+ET_{rad}=\frac{0.408 \Delta (R_n-G)+\gamma 
(\frac{900}{T+273})u_2(e_s-e_a)}{\Delta+\gamma(1+0.34 u_2)}" 
displayMode="true"></latex>.*?") it's going to return false. What I really 
want to do is another equation.match(".*?e_a.*?") for each of the variable 
tiddlers, but I can't figure out how to do that match format in the filter. 
It looks like the regexp filter expressions can only reference the field of 
the tiddler it's looking through for the object of the regular expression 
and can't use the field of the calling tiddler instead.


\define makePattern() 
^<.*?(?:=).*?(?:=).*?(?:$(var)$)
\end

</$set>
<$set name="var" value={{!!variable}}>
<$set name="varpattern" value=<<makePattern>>>
<$list filter="[tag[Equation]regexp:equation<varpattern>]">
<$transclude field="title"/>
<$transclude field="equation"/>
</$list>
</$set>
</$set>

I looked at the matchfilter plugin, but that doesn't solve the problem I am 
having. I did look at it as an example of how I might write my own plugin 
but I'm still learning javascript macro syntax and couldn't quite follow 
all the code.

Thanks,

Sara

On Sunday, January 15, 2017 at 9:40:56 AM UTC-6, Tobias Beer wrote:
>
> Hi again,
>
> Not sure if it's compatible to the current version of TiddlyWiki,
> something like EucalyJ's *matchfilter* might do what you want.
>
> http://eucaly-tw5.tiddlyspot.com/#MatchFilter
>
> Best wishes,
>
> Tobias.
>

-- 
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/0c29e449-6d9f-4477-9022-bc6447309a25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to