[tw5] Re: Macro Help: Transcluding the name of the tiddler the macro was called from as a parameter

2018-07-25 Thread TonyM
Joe,

I am not answering your question but possibly pointing you in another 
direction.

TiddlyWiki comes with a set of Table Of Content Macros. TiddlyWiki itsself 
is a great source of inspiration for building on top of tiddlywiki.

In fact you can possibly use the toc macro now.

The TOC macros use recursion. Basically you call a macro which calls 
itself, using the list widget each time the list runs out it returns to the 
calling macro (which is itself) and this is how the toc macros dig deep 
into the tree created by tagging.

Have a search for the macros (start on tiddlywiki.com), or ask further 
questions here.

Regards
Tony


On Thursday, July 26, 2018 at 6:50:45 AM UTC+10, Joe Bush wrote:
>
> This is a very short text case for a macro I want to use inside a larger 
> <$list>, so just using the default/currentTiddler won't work then.
>
> \define test( level:3 base:{{!!title}} )
> $level$, $base$
> <$reveal type=gteq state="$base$!!depth" text=2>
> WHEEE
> 
> \end
>
> <>
>
>
> The intent is to build a list tree macro where I can pass in a level and 
> have it build a tree that many levels deep. I'm using Reveal for the deeper 
> parts, and am trying to use set the state in the macro parameters. As far 
> as I understand it, I can't just do 
>
> state="$level$"
>
> to get the state because state is a TextReference, which expects to be 
> either a tiddler or a field, not just a simple string. I don't want to have 
> to create state tiddlers manually for each time I want to call this macro, 
> because there'll be a lot of them.
>
> Any ideas?
>

-- 
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/9da64572-5ce1-4b40-bd8f-a2aa32cc11c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Macro Help: Transcluding the name of the tiddler the macro was called from as a parameter

2018-07-25 Thread 'Mark S.' via TiddlyWiki
It depends on what you're doing, and where the equivalent information of 
"depth" is coming from. You might explain more about your set-up.

Instead of reveal, you might be able to use a listwidget 

<$list filter="[...stuff I'm looking for 
...count[]prefix[$level$]suffix[$level$]]"> WHEE 

-- Mark

On Wednesday, July 25, 2018 at 3:24:19 PM UTC-7, Joe Bush wrote:
>
> Thanks Mark! That does indeed work.
>
> I'd also be interested to know if there's a way to take the depth field 
> out of the equation and use the level parameter instead, since I seem to 
> keep needing that kind of thing.
>
> On Wednesday, July 25, 2018 at 4:42:57 PM UTC-5, Mark S. wrote:
>>
>> I don't believe you can use a dynamic default as you are attempting in 
>> your example.
>>
>> Instead, try:
>>
>> \define test( level:3 base )
>> $level$, $base$
>>
>> <$reveal type=gteq state="$base$!!depth" text=2>
>> WHEEE
>> 
>> \end
>>
>> <$macrocall $name="test" level=4 base={{!!title}}/>
>>
>> -- Mark
>>
>>
>> On Wednesday, July 25, 2018 at 1:50:45 PM UTC-7, Joe Bush wrote:
>>>
>>> This is a very short text case for a macro I want to use inside a larger 
>>> <$list>, so just using the default/currentTiddler won't work then.
>>>
>>> \define test( level:3 base:{{!!title}} )
>>> $level$, $base$
>>> <$reveal type=gteq state="$base$!!depth" text=2>
>>> WHEEE
>>> 
>>> \end
>>>
>>> <>
>>>
>>>
>>> The intent is to build a list tree macro where I can pass in a level and 
>>> have it build a tree that many levels deep. I'm using Reveal for the deeper 
>>> parts, and am trying to use set the state in the macro parameters. As far 
>>> as I understand it, I can't just do 
>>>
>>> state="$level$"
>>>
>>> to get the state because state is a TextReference, which expects to be 
>>> either a tiddler or a field, not just a simple string. I don't want to have 
>>> to create state tiddlers manually for each time I want to call this macro, 
>>> because there'll be a lot of them.
>>>
>>> Any ideas?
>>>
>>

-- 
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/6bd1854b-b7d3-46f3-9f28-ddf3503f0306%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Macro Help: Transcluding the name of the tiddler the macro was called from as a parameter

2018-07-25 Thread Joe Bush
Thanks Mark! That does indeed work.

I'd also be interested to know if there's a way to take the depth field out 
of the equation and use the level parameter instead, since I seem to keep 
needing that kind of thing.

On Wednesday, July 25, 2018 at 4:42:57 PM UTC-5, Mark S. wrote:
>
> I don't believe you can use a dynamic default as you are attempting in 
> your example.
>
> Instead, try:
>
> \define test( level:3 base )
> $level$, $base$
>
> <$reveal type=gteq state="$base$!!depth" text=2>
> WHEEE
> 
> \end
>
> <$macrocall $name="test" level=4 base={{!!title}}/>
>
> -- Mark
>
>
> On Wednesday, July 25, 2018 at 1:50:45 PM UTC-7, Joe Bush wrote:
>>
>> This is a very short text case for a macro I want to use inside a larger 
>> <$list>, so just using the default/currentTiddler won't work then.
>>
>> \define test( level:3 base:{{!!title}} )
>> $level$, $base$
>> <$reveal type=gteq state="$base$!!depth" text=2>
>> WHEEE
>> 
>> \end
>>
>> <>
>>
>>
>> The intent is to build a list tree macro where I can pass in a level and 
>> have it build a tree that many levels deep. I'm using Reveal for the deeper 
>> parts, and am trying to use set the state in the macro parameters. As far 
>> as I understand it, I can't just do 
>>
>> state="$level$"
>>
>> to get the state because state is a TextReference, which expects to be 
>> either a tiddler or a field, not just a simple string. I don't want to have 
>> to create state tiddlers manually for each time I want to call this macro, 
>> because there'll be a lot of them.
>>
>> Any ideas?
>>
>

-- 
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/c70dbd02-6999-4ca3-8e89-b77199aa07e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Macro Help: Transcluding the name of the tiddler the macro was called from as a parameter

2018-07-25 Thread 'Mark S.' via TiddlyWiki
I don't believe you can use a dynamic default as you are attempting in your 
example.

Instead, try:

\define test( level:3 base )
$level$, $base$

<$reveal type=gteq state="$base$!!depth" text=2>
WHEEE

\end

<$macrocall $name="test" level=4 base={{!!title}}/>

-- Mark


On Wednesday, July 25, 2018 at 1:50:45 PM UTC-7, Joe Bush wrote:
>
> This is a very short text case for a macro I want to use inside a larger 
> <$list>, so just using the default/currentTiddler won't work then.
>
> \define test( level:3 base:{{!!title}} )
> $level$, $base$
> <$reveal type=gteq state="$base$!!depth" text=2>
> WHEEE
> 
> \end
>
> <>
>
>
> The intent is to build a list tree macro where I can pass in a level and 
> have it build a tree that many levels deep. I'm using Reveal for the deeper 
> parts, and am trying to use set the state in the macro parameters. As far 
> as I understand it, I can't just do 
>
> state="$level$"
>
> to get the state because state is a TextReference, which expects to be 
> either a tiddler or a field, not just a simple string. I don't want to have 
> to create state tiddlers manually for each time I want to call this macro, 
> because there'll be a lot of them.
>
> Any ideas?
>

-- 
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/02557e28-cbc1-44d9-b06a-06b69e1e7a8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] Re: Macro Help: Transcluding the name of the tiddler the macro was called from as a parameter

2018-07-25 Thread Joe Bush
The question could be rephrased as "How do I use a Macro Parameter as the a 
Reveal State?"

On Wednesday, July 25, 2018 at 3:50:45 PM UTC-5, Joe Bush wrote:
>
> This is a very short text case for a macro I want to use inside a larger 
> <$list>, so just using the default/currentTiddler won't work then.
>
> \define test( level:3 base:{{!!title}} )
> $level$, $base$
> <$reveal type=gteq state="$base$!!depth" text=2>
> WHEEE
> 
> \end
>
> <>
>
>
> The intent is to build a list tree macro where I can pass in a level and 
> have it build a tree that many levels deep. I'm using Reveal for the deeper 
> parts, and am trying to use set the state in the macro parameters. As far 
> as I understand it, I can't just do 
>
> state="$level$"
>
> to get the state because state is a TextReference, which expects to be 
> either a tiddler or a field, not just a simple string. I don't want to have 
> to create state tiddlers manually for each time I want to call this macro, 
> because there'll be a lot of them.
>
> Any ideas?
>

-- 
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/9e1eccff-5d7e-4859-8fff-7ab14d2b1576%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.