Hi,
*the problem in my macro "counting" is that I am duplicating code to get
the tiddlers and count them. I have tried with auxilliary variable or
macro, but I was unable to get it work. *
- In many ways this is not a problem in itself unless you have very
large data
- You could manipulate the second filter to also count and prefix the
output with the number, however little is gained
- Keeping it as it is is more clear and self documenting
*Also, the work to get the tiddlers would also be of use for generating my
list. As for this one, I would need a "map" filter and a "reduce" or "join"
filter to achieve my goal. But these do not exist. *
Then we create them, but I am not sure that we can't do the equivalent
already. I am not sufficiently well versed to build these, if you could
define the terms as you envisage, perhaps I/others can build something.
There is Join and split and more in filters already, but the tiddler as
record makes this easy.
*And with the tools available, I can get my list of tiddlers, and use
strings filter operator to make something ot of it. I've read that I would
need special attention as I want to output tiddlywiki code to be
interpreted by TW instead of basic texts, but for the time being, just
outputing the tw code would be so sweet! *
To generate code is quite easy, but to see anything, tiddlywiki does a
final render to html. Its understanding this that that will help you
implement this. Many of us make use of templates as does the system to
export json and static tiddlers. A template contains the login of the
output and that result is evaluated (eg wikified) to generate the result.
When it comes to templates some advice I got which, I have not explored in
detail yet, is using the macro definitions to contain the template
definitions, using $(varname)$ substitutions to incorporate dynamic content.
*You mention "map" filter and a "reduce" or "join" *
I am investigating using tiddlywiki as a tool for manipulating *LittleData*
rather than *bigdata*. Basically to extract optimised decision trees etc...
Then "little bit bigger data" can be logging of activity in tiddlywiki
itself, so we can build smart analytics that observes the authors use of
tiddlywiki, with a view to discovering things not evident on the surface.
*Perhaps you could expand on this? *
*If the current tiddler in my filter generated list of tiddlers is "fubar",
I can easily transform it in "!!! [[fubar]]" or "{{fubar}}" but I am unable
to get "!!! [[fubar]]\n{{fubar}}" because I can't duplicate "fubar" or
don't know how to. An other possibility would be a sprintf-like filter or
macro. *
- Here your provide a pseudo code for what you want, perhaps ask for it
in plain English?
- I am sure the below is enough to answer, although perhaps technically
it does?
*Here is my Guess at a solution*
<$list filter="[[fubar]]">
!!<$link/>
<$transclude/>
</$list>
I use list simply to set the current tiddler and use the defaults for the
link and transclude widgets.
Regards
Tones
On Saturday, 19 September 2020 at 03:27:41 UTC+10 [email protected]
wrote:
> I have a TW where some tiddlers are also tags. They tags themselves and a
> bunch of other tags.
>
> For each of those tags, I want to tell how many tiddlers tag them and make
> a list of them which would look like that if I do it manually (the case as
> of now):
>
> !!! [[foo tiddler]]
> {{foo tiddler}}
>
> !!! [[bar tidller]]
> {{bar tiddler}}
>
> (the link allow me to edit them, but I want to see their contents on my
> page.)
>
> As for the number of tiddlers, I have done this macro:
> \define counting()
> <$set name="qty" filter="[all[current]tagging[]butfirst[]count[]]">
> <$set name="label"
> filter="[all[current]tagging[]butfirst[]count[]compare:number:gt:[1]then[tests]else[test]]">
> <<qty>> <<label>>
> </$set></$set>
> \end
>
> which I used like this, simply:
>
> <<counting>>
>
> and I get something like "42 tests" or "1 test". (the tagging tiddlers are
> describing tests).
>
> the problem in my macro "counting" is that I am duplicating code to get
> the tiddlers and count them. I have tried with auxilliary variable or
> macro, but I was unable to get it work.
>
> Also, the work to get the tiddlers would also be of use for generating my
> list. As for this one, I would need a "map" filter and a "reduce" or "join"
> filter to achieve my goal. But these do not exist. And with the tools
> available, I can get my list of tiddlers, and use strings filter operator
> to make something ot of it. I've read that I would need special attention
> as I want to output tiddlywiki code to be interpreted by TW instead of
> basic texts, but for the time being, just outputing the tw code would be so
> sweet!
>
> If the current tiddler in my filter generated list of tiddlers is "fubar",
> I can easily transform it in "!!! [[fubar]]" or "{{fubar}}" but I am unable
> to get "!!! [[fubar]]\n{{fubar}}" because I can't duplicate "fubar" or
> don't know how to. An other possibility would be a sprintf-like filter or
> macro.
>
>
>
--
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/7b2c0bc3-8efe-4d2d-a30f-5c2588999ffcn%40googlegroups.com.