Does this plugin exist?

21 views
Skip to first unread message

Amzg

unread,
Aug 29, 2008, 8:41:32 PM8/29/08
to TiddlyWiki
A "pretty page plugin", that has the same effect as showing one
tiddler containing;
<<tiddler TidOne>>
<<tiddler TidTwo>>
<<...

...where TidOne, TidTwo, etc are *tagged* with some certain tag.

I.e a plugin that groups contents of tiddlers with a common tag, into
one tiddler (possibly a tiddler named that very tag?).

I would love this particularly for presentational purposes where it
often simply would look better aesthetically if all wasn't split up in
tiddlers.

Thanks

/Mat

Eric Shulman

unread,
Aug 29, 2008, 9:35:01 PM8/29/08
to TiddlyWiki
> groups contents of tiddlers with a common tag, into
> one tiddler (possibly a tiddler named that very tag?).
>
> I would love this particularly for presentational purposes where it
> often simply would look better aesthetically if all wasn't split up in
> tiddlers.

Try this inline script:
http://www.TiddlyTools.com/#EmbedTiddlers

Usage:
<<tiddler EmbedTiddlers with:
"TiddlerName [[TiddlerName with spaces]] TiddlerName ...">>
or
<<tiddler EmbedTiddlers with: @TiddlerName>>
or
<<tiddler EmbedTiddlers with: =tagValue>>

where
@TiddlerName
specifies a //separate// tiddler containing the space-separated,
bracketed list of tiddlers to transclude (e.g., DefaultTiddlers)
=tagValue
embeds all tiddlers tagged with the indicated value

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

wolfgang

unread,
Aug 30, 2008, 8:43:06 AM8/30/08
to TiddlyWiki
Hi Mat,

For presentation purposes I consider ShowTabsForTags even better:

http://www.TiddlyTools.com/#ShowTabsForTags

Note: this also needs InlineJavascriptPlugin installed.

http://www.tiddlytools.com/#InlineJavascriptPlugin

Regards,

W.

Amzg

unread,
Aug 30, 2008, 11:19:24 AM8/30/08
to TiddlyWiki
> Try this inline script:
> http://www.TiddlyTools.com/#EmbedTiddlers

Thanks Mr.Shulman! That's a great start. One power feature in TW is
the tagging, so the "EmbedTiddlers with: =tagValue" is particularly
valuable. But I think a few aspects are needed to make it fully
useful, particularly if "laymen" are supposed to see the resulting
tiddler:

The "with: Tiddlername" allows for control over the *order* of the
presented tiddlers, but also the =tagValue variant ought to allow
control over this, for result to make sense. If I understand it right,
the tiddlers are now presented alphabetically by name, but a much more
powerful way would be by letting the tag argument be dynamic such as
'sometag#" or "sometag.#" (i.e with some separator) or "sometag*" (and
maybe even "some*tag - for example "pasta.*.tomato" for both tomato
based fussili and gnocchi )

Other than presenting pasta tastefully I see at least one other *very*
valuable IRL application: Effectively authoring books and manuals!
The script would allow the non-linear TW to ALSO contribute to to
linear applications! I.e new bits (tiddlers) are tagged with chapter
and paragraph names/numbers and executing the script renders a
tasteful presentation of the so-far results. This would simplify non-
linear/fragmented authoring which of course is closer to how our
brains work. It would of course not be a text editor - copy/paste
would be necessary later.

(Imagine if this board was actually a TW. Good replies could be tagged
with Chapter names. Execute script and we have a book almost ready to
print, totally based on user questions i.e truly answering whatever
users want to know. I have some further conceptual thoughts on the
idea if anyone was actually to pick up on this.
Authors? Just do a tag cloud.... and manually shrink the name Eric so
it doesn't pass the edges of the book... ;-)


Thanks

/Mat

Eric Shulman

unread,
Aug 30, 2008, 12:12:43 PM8/30/08
to TiddlyWiki
> The "with: Tiddlername" allows for control over the *order* of the
> presented tiddlers, but also the =tagValue variant ought to allow
> control over this, for result to make sense. If I understand it right,
> the tiddlers are now presented alphabetically by name

To apply complex tag matching criteria, you can use:
http://www.TiddlyTools.com/#MatchTagsPlugin

... and, I've just updated EmbedTiddlers so that, when MatchTagsPlugin
is installed, it can use **full boolean logic expressions**, like
this:

<<tiddler EmbedTiddlers with: [[=pasta AND tomato]]>>

or this:

<<tiddler EmbedTiddlers with: [[=(pasta AND NOT gnocci) AND tomato]]>>

... and, I've also added an optional second param that lets you
specify the sort order for the resulting list of tiddlers, based on
*any* tiddler field (including custom fields), using a prefix of "+"
or "-" to indicate ascending/descending. For example, using "-
modified" will list tiddlers in the order they were modified, most
recent first.

<<tiddler EmbedTiddlers with: [[=(pasta AND NOT gnocci) AND tomato]] -
modified>>

Get the updated script (v1.2.0) here:
http://www.TiddlyTools.com/#EmbedTiddlers

enjoy,
-e

Amzg

unread,
Aug 30, 2008, 6:41:46 PM8/30/08
to TiddlyWiki
Mr. Shulman - fantastic work, as... well, always ;-)

First off a smallie; In the updated description, it says that
MatchTagsPlugin (MTP) is needed for booleans, but it appears it is
needed also for simple "=tagValue" such as "=test". (I got
ReferenceError: getTaggedTiddlers is not defined" for this simple tag
value before installing MatchT...)

I'm not quite sure I understand everything you so kindly reply though.
Let me first ask if it now somehow in the EmbedTiddlers is possible to
control the order of individual tiddlers in a rendered list by use of
tag expressions? If the answer is yes, then please disregard the rest
of this post.

...or can it be accomplished when both EmbedTiddlers (ET) and MTP are
used? But, if so, how would I render such a certain order? And how
could ET and MTP interact?

In the MTP description of 'format' I notice that all fields for a
tiddler except 'tags' are mentioned. Would it be possible to generate
a controlled order of specifically tagged tiddlers by using MTP and
the Description fields? I.e first with MTP filtering by tag and then
sorting by Description - and somehow sending it off to ET to display
it all to the layman as one big beautiful tiddler?


Thank you!

/Mat

Amzg

unread,
Aug 30, 2008, 6:54:41 PM8/30/08
to TiddlyWiki
Wolfgang, I appreciate your answer but as may have become evident I'm
more looking for what Mr.Shulman is on to. My hope is to be able to
generate tag-filtered lists and present the result in a desired order
and in apparently one tiddler.

Although I have a particular application in mind, I must assume this
should be of general interest, e.g see IRL examples above. Actually,
is there any other way to linearize tiddler groups when desired, such
as for book writing?

Thanks

/Mat

Eric Shulman

unread,
Aug 30, 2008, 8:22:46 PM8/30/08
to TiddlyWiki
> First off a smallie; In the updated description, it says that
> MatchTagsPlugin (MTP) is needed for booleans, but it appears it is
> needed also for simple "=tagValue" such as "=test". (I got
> ReferenceError: getTaggedTiddlers is not defined" for this simple tag
> value before installing MatchT...)

oops! That's a bug... *squish*.... fixed.

Get the update (v1.2.1) here:
http://www.TiddlyTools.com/#EmbedTiddlers

> control the order of individual tiddlers in a rendered list by use of
> tag expressions?

Sorry, no. If you want to specify an *arbitrary display order* for
EmbedTiddlers, you can't use the automatic "=tagValue" matching.

Tag expressions can be used to *select* tiddlers based on complex
combinations of tags, but the *order* of those tiddlers is determined
programmatically by sorting on a specified tiddler field (e.g., "-
modified").

To define an arbitrary tiddler order, you need to define the list of
the tiddlers you want, in the desired order. This list can either be
entered directly as parameters passed to EmbedTiddlers, or by using a
separate 'story' tiddler containing a space-separate, bracketed list
of tiddler titles (e.g., just like DefaultTiddlers), and entering that
tiddler title (preceded by an @ sign) as the only parameter for
EmbedTiddlers.

You can easily *generate* a story tiddler by using
http://www.TiddlyTools.com/#StorySaverPlugin
Start by opening all the tiddlers you want, in the order you want
them. Then, use the <<saveStory>> macro:
<<saveStory ask "save story" "save a list tiddlers">>
When you click the "save story" command link, you will be prompted for
a new tiddlername (e.g., [[MyStory]]) in which to save the list of
tiddlers currently being displayed. You can then use
<<tiddler EmbedTiddlers with: @MyStory>>
to render the entire story within a single tiddler.

Amzg

unread,
Aug 31, 2008, 6:42:44 PM8/31/08
to TiddlyWiki
Thanks you so much Mr.Shulman! Very valuable info on how to use the
two combined - I'm using it and it works wonderfully. It even does
*not* break between two adjacent tiddlers, allowing for instance a
sentence to start in one tiddler and finish in another, coalescing
seamlessly! And with immediate updating in the resulting tiddler,
without manually running any commands. Wonderful!

Question;

Is there *any* existing way to handle tags "with asterisks", i.e
where
tag* = tag, tags, tagliattelle etc? I dont' recall ever seeing this in
TW, but it does feels relevant to boolean expression handling. (I
don't know the general term for dealing with asterisks - i.e if I did,
then I could search for tools myself.) The optimal would be some kind
of filtering tool allowing boolean expressions in combo with
asterisks.

Thank you!

/Mat

Eric Shulman

unread,
Sep 1, 2008, 12:36:13 PM9/1/08
to TiddlyWiki
> Is there *any* existing way to handle tags "with asterisks", i.e
> where
> tag* = tag, tags, tagliattelle etc? I dont' recall ever seeing this in
> TW, but it does feels relevant to boolean expression handling. (I
> don't know the general term for dealing with asterisks - i.e if I did,
> then I could search for tools myself.) The optimal would be some kind
> of filtering tool allowing boolean expressions in combo with
> asterisks.

Javascript (and many other languages) use a syntax called "regular
expressions" to define text patterns. TiddlyWiki makes extensive use
of regular expression pattern matching throughout it's processing.
Most notably, the core wikify() engine uses regular expressions to
recognize and render TW wiki syntax.

Unlike filesystem patterns that use "*" to denote a sequence of "0 or
more" wildcard characters, the javascript regular expression syntax
for matching a sequence of wildcard characters is: .* ("dot
star").

The good news is: the latest update to MatchTagsPlugin (v1.9.1)
permits use of javascript regular expression syntax, allowing you to
easily match several similar tags at once! Thus, to match "tag",
"tags", or "tagliattelle", you would write:
<<matchTags "%0" "\n" "tag.*">>

Get the update here:
http://www.TiddlyTools.com/#MatchTagsPlugin

Amzg

unread,
Sep 1, 2008, 5:38:57 PM9/1/08
to TiddlyWiki
WHOAAAA!!!! I haven't had a chance to try anything out yet, but I
can't tell how excited this makes me, not to flattered!!!

The following is not intended for Mr.Shulmans ears. I'm only talking
to you other guys:

Guys... I'm discussing with the Nobel Prize Academy here in Stockholm
about a nomination for Mr.Shulman. Daaemn - he should at least be
nominated King of TW. I hope I'm not stepping on anyones toes by
expressing this, but this mister must have single-handedly contributed
20% of all TW extensions out there. And if we limit it to the most
usable ones, then an even higher percentage. And how about his
generous participation on the various boards - even spending time on
questions from small guys like me. And those answers - they're just
encyclopedic!

Maybe this admirers post is considered spam by someone... but I just
*can't* hold it in;
Mr.Shulman is just ASTONISHING!

/Mat
Reply all
Reply to author
Forward
0 new messages