Eric et al.

*Thanks for that; Amazing no matter how long I looked I did not see it.*

*I went for the wikify because I wrongly though I could not add "(" in the 
search string. But it works, thanks again.*

   - "[all[shadows+tiddlers]search:text:literal[\define $macroname$*(*]]" I 
   added the ( and now the result is only
   
$:/core/macros/tag
$:/core

*So now this get's the tiddler(s) I am after with;*

   - <$list filter="[all[shadows+tiddlers]search:text:literal[\define 
   $macroname$*(]] -[[$:/core]]*">

*Do you think it an ok assumption for the next character to be "(" ?*

Now I share back the result;
\define ?(macroname:"?")
<$list filter="""[[$macroname$]match[?]]""">
   Macro to display more about a given macro, `<<? macroname>>`
</$list>
<$list filter="""[[$macroname$]!match[?]]""" variable=nul>
   <$list filter="[all[shadows+tiddlers]search:text:literal[\define 
$macroname$(]] -[[$:/core]]">
        Macro '$macroname$' defined in <$link/> 
        <$list filter="[all[current]get[text]splitregexp[\n]prefix[\define 
$macroname$(]removeprefix[\define ]]">
             <$text text=<<currentTiddler>>/>
        </$list> with 
        <$list 
filter="[all[current]enlist{!!tags}]">{{||$:/core/ui/TagTemplate}}</$list><br>
   </$list>
</$list>
\end

<<?>><hr>
<<? tag>><hr>
<<? tag-pill-body>>

*What do you, or others think?*

   - It also exposes parameters in the definition
   - Is it worthy of inclusion in the standard distribution (one day)?
   - Shows how parameter defaults are also exposed eg tree macro

*Other possibilities*

   - Optionally return the full definition, needs to end with the next 
   \define or \end but what if single line last macro?
   - Return the tiddlers description is available and perhaps some hidden 
   documentation inside <!-- comments -->
      - eg lines beginning with macro name
      - Or look up a data tiddler for core macros with additional notes.
   
Thanks again Eric.

Regards
Tones

On Tuesday, 22 September 2020 at 13:32:24 UTC+10 Eric Shulman wrote:

> On Monday, September 21, 2020 at 7:47:31 PM UTC-7, TW Tones wrote:
>>
>> I am building a macro "?" to locate and display information on defined 
>> macros.
>> However I cant get the basic operation to work, pasting this in a tiddler 
>> on tiddlywiki will show these unwanted ]"> ]"> ]"> ]"> ]"> ]"> </$list> 
>> after the two top level lists.
>> I cant work out why, I would be grateful for a second or more eyes.
>>
>> \define macro-definition(macroname) \define $macroname$(
> \define ?(macroname:"?")
> <$wikify name=macro-definition text="""<<macro-definition $macroname$>>"""
> >
> searching for: <<macro-definition>>.<br>
> <$list filter="""[[$macroname$]match[?]]""">
>    Macro to display more about a given macro, `<<? macroname>>`
> </$list>
> <$list filter="[[$macroname$]!match[?]] variable=nul>
> searching for: <<macro-definition>><br>
>    <$list 
> filter="[all[shadows+tiddlers]search:text:literal<macro-definition>]">
>
>    </$list>
> </$list>
> </$wikify>
> \end
>
> You've left off a close quote in the 2nd $list filter!
>
> Here's my cleaned up revision of your code.  Note there's no need for 
> $wikify.
> \define ?(macroname:"?")
> searching for: \define $macroname$<br>
>
> <$list filter="[[$macroname$]match[?]]">
>    Macro to display more about a given macro, ``<<? macroname>>``
> <
> /$list>
>
> <$list filter="[[$macroname$]!match[?]]">
>    <$list filter="[all[shadows+tiddlers]search:text:literal[\define 
> $macroname$]]">
>
>    </$list>
> </$list>
> \end
>
> With the above code, and a test case of "<<? tag>>", I get the following 
> results at http://tiddlywiki.com...
>
> searching for: \define tag
>> $:/core/ui/EditTemplate/tags
>> $:/Manager/ItemSidebar/Tags
>> $:/core/macros/tag-picker
>> $:/core/macros/tag
>> $:/core
>> $:/editions/tw5.com/macro-examples/tags-of-current-tiddler
>
>
> -e
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/777a6c84-70f8-486c-85ec-bf14d36773b6n%40googlegroups.com.

Reply via email to