Import a list

7 views
Skip to first unread message

AviMar

unread,
Feb 17, 2008, 6:32:41 PM2/17/08
to TiddlyWiki
Hi, is there an easy way to import a list - a title and the text -
with a specified tag? I have 48, and I can format it pretty much
however, or can write a reg-ex inside the importer.

Any ideas?
Thanks!!
Avi


(Some more info:)
I want to journal about the entries in the book the 48 laws of power.
I want to be able to click "new journal" so that they get tagged
according to which one. I found the summaries online in this format:


Law 45

Preach the Need for Change, but Never Reform too much at Once

Everyone understands the need for change in the abstract, but on the
day-to-day level people are creatures of habit. Too much innovation
is traumatic, and will lead to revolt. If you are new to a position
of power, or an outsider trying to build a power base, make a show of
respecting the old way of doing things. If change is necessary, make
it feel like a gentle improvement on the past.

Law 46

Never appear too Perfect

Appearing better than others is always dangerous, but most dangerous
of all is to appear to have no faults or weaknesses. Envy creates
silent enemies. It is smart to occasionally display defects, and
admit to harmless vices, in order to deflect envy and appear more
human and approachable. Only gods and the dead can seem perfect with
impunity.

I want to call them.. "Law 45 - Preach the Need for Change, but Never
Reform too much at Once"
Have the text be italics of the long one, and be tagged [[48Laws of
Power]]

Daniel Baird

unread,
Feb 17, 2008, 10:16:51 PM2/17/08
to Tiddl...@googlegroups.com
Make one manually, save it, and then have a look at how that tiddler
is stored in your TiddlyWiki's html. You'll fairly easily be able to
create that tiddler format directly. Then you can just paste your
constructed tiddlers right into your TiddlyWiki.

Cheers
;Daniel

--
Daniel Baird
i neeber olok at ym kyebord wen i tpey

Eric Shulman

unread,
Feb 17, 2008, 10:49:07 PM2/17/08
to TiddlyWiki
> Hi, is there an easy way to import a list - a title and the text -
> with a specified tag? I have 48, and I can format it pretty much
> however, or can write a reg-ex inside the importer.

Try this:
http://www.TiddlyTools.com/#SplitTiddler

To prepare your data:

* Create a single tiddler containing the entire set of 48 items.
* Separate each item by a TW "horizontal rule" (HR)
* The first line of each item is the 'target' tiddler title
* The remaining lines in the item are the tiddler's content

For example, create [[SourceTiddler]], containing:

This is Title One
this is the content
for the first tiddler
----
This is Title Two
this is the content
for the second tiddler
----
This is Title Three
this is the content
for the third tiddler

Then, using the HTML form provided by [[SplitTiddler]], enter the name
of your 'source tiddler' and the tags for the 'target' tiddlers (space-
separated, bracketed as needed), and press the "split tiddler" button:
a new tiddler will be created and displayed for each item in the
source tiddler. Note: this might take a little while depending upon
your document's overall performance characteristics (e.g., total # of
tiddlers, overhead from compute-intensive macros, etc.)

QED.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

AviMar

unread,
Feb 18, 2008, 1:46:00 AM2/18/08
to TiddlyWiki
Eric, you are amazing!
-Avi

AviMar

unread,
Feb 18, 2008, 6:46:55 AM2/18/08
to TiddlyWiki
Hate to be a spoil sport, but it only seems to import only the first
one. I c/v your sample, same thing..
-Avi

On Feb 18, 5:49 am, Eric Shulman <elsdes...@gmail.com> wrote:

Eric Shulman

unread,
Feb 18, 2008, 7:05:29 AM2/18/08
to TiddlyWiki
> Hate to be a spoil sport, but it only seems to import only the first
> one. I c/v your sample, same thing..

oops! My bad. There was a subtle in the "displayTiddler(...)" call
that was being 'masked' on TiddlyTools due to a CoreTweak. I've fixed
the reference, and it should now work in your document as well.

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

Avi Marcus

unread,
Feb 18, 2008, 7:41:27 AM2/18/08
to Tiddl...@googlegroups.com
Weird. I took the new 2.3 core and imported all my stuff from the monkey gtd. It all seems to work fine.
But your code failed silently again. I tried it in a new, empty doc and it worked fine. I imported the results...
-Avi

cmari

unread,
Feb 29, 2008, 7:11:17 AM2/29/08
to TiddlyWiki
This is a really neat and useful script - thanks! In case it might
help someone else: I initially had the same problem Avi did until I
remembered to add one last TW "horizontal rule" at the very end of my
list.
cmari
Reply all
Reply to author
Forward
0 new messages