Cataloging An Inventory of Off Highlighted Phrases (within a TW)

13 views
Skip to first unread message

Digital Doctor

unread,
Jan 1, 2008, 11:16:50 AM1/1/08
to TiddlyWiki
The most fulfilling and safe New Year to ALL.

-------------

I'll be keeping a journal over the next 45 days or so.
Each day I'll be 'highlighted' (@@highlighting@@) a
particular insight of the day.

I'd like to be able to extract these highlights, at the end
of the journey, and catalog them into one tiddler.

Can some one advise a Macro or Plugin for this?

Thanks.

RC

FND

unread,
Jan 1, 2008, 4:09:21 PM1/1/08
to Tiddl...@googlegroups.com
> I'd like to be able to extract these highlights, at the end
> of the journey, and catalog them into one tiddler.

Try this FET* script:
---------------
<<forEachTiddler
script 'function extract(str, RE) {
var r = [];
str.replace(/@{2}(.+?)@{2}/g, function(a, b) { r.push(b); });
return r;
}'
write 'extract(tiddler.text).join("\n");'
>>
---------------
Keep in mind that with a large TiddlyWiki, this might take a while to
process. (Though that processing will only occur when this macro - that
is, the respective tiddler - is rendered.)

HTH.


-- F.


* http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin

FND

unread,
Jan 1, 2008, 4:21:39 PM1/1/08
to Tiddl...@googlegroups.com
> Try this FET* script: [...]

Minor correction:


---------------
<<forEachTiddler
script 'function extract(str, RE) {
var r = [];

str.replace(RE, function(a, b) { r.push(b); });
return r;
}'
write 'extract(tiddler.text, /@{2}(.+?)@{2}/g).join("\n");'
>>
---------------


-- F.

Digital Doctor

unread,
Jan 2, 2008, 12:04:08 AM1/2/08
to TiddlyWiki
Blessings and Peace:

F., wishing you the most enjoyable New Year.

-----

Just to be 'newbie clear':

a) Install the FET plugin

b) When I am ready to generate the
'inventory tiddler', open a new tiddler
and insert the script you've provided

Is that correct?

-----

How do I update this particular 'inventory
tiddler', from time to time; or does
it automatically include an entry into
the 'inventory' as they are found within
a TW.

Thanks for your insight.

TW

Eric Shulman

unread,
Jan 2, 2008, 12:48:23 AM1/2/08
to TiddlyWiki
> Just to be 'newbie clear':
> a) Install the FET plugin
> b) When I am ready to generate the
> 'inventory tiddler', open a new tiddler
> and insert the script you've provided
>
> How do I update this particular 'inventory
> tiddler', from time to time; or does
> it automatically include an entry into
> the 'inventory' as they are found within
> a TW.

The use of <<forEachTiddler>> "scans" all the tiddlers to find the
items of interest. However, it does NOT write it's results into a
*stored* tiddler that has to be periodically "updated". Rather, it
generates output directly into the current tiddler *display* each and
every time that tiddler is rendered.

-e
Reply all
Reply to author
Forward
0 new messages