Externally import tiddlers

136 views
Skip to first unread message

Richard Hopkins-Lutz

unread,
May 21, 2015, 4:53:58 PM5/21/15
to tiddl...@googlegroups.com
I apologize if this has been asked before, or if it is in the documentation.

Is there a way to generate tiddlers and insert them into the code directly using an external script? Let's say I had a large batch of text files and I wanted to process them into individual tiddlers, is there some way to insert them directly into the code of a TW5 file as tiddlers? Is there documentation on how to do this?

Eric Shulman

unread,
May 21, 2015, 5:21:14 PM5/21/15
to tiddl...@googlegroups.com
On Thursday, May 21, 2015 at 1:53:58 PM UTC-7, Richard Hopkins-Lutz wrote:
I apologize if this has been asked before, or if it is in the documentation.

Is there a way to generate tiddlers and insert them into the code directly using an external script? Let's say I had a large batch of text files and I wanted to process them into individual tiddlers, is there some way to insert them directly into the code of a TW5 file as tiddlers? Is there documentation on how to do this?

If you can use drag-and-drop.... just select all the text files and drop them into an open TiddlyWiki and they will be imported as separate tiddlers, using the filename as the tiddlername.

Note: the "type" field of each tiddler will be set to "text/plain".  If you want to add wiki syntax to the imported text, you will need to clear the type field in the tiddler editor (click the trash can next to the field).

enjoy,
-e
Eric Shulman
ELS Design Studios
TiddlyTools - "Small Tools for Big Ideas!"
InsideTiddlyWiki: The Missing Manuals

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:

Jon

unread,
May 21, 2015, 5:54:45 PM5/21/15
to tiddl...@googlegroups.com
Hi Richard,

you might also find this useful https://gist.github.com/Jermolene/1c1ff69c7afe91550057

Regards
Jon

Danielo Rodríguez

unread,
May 21, 2015, 6:49:09 PM5/21/15
to tiddl...@googlegroups.com


El jueves, 21 de mayo de 2015, 22:53:58 (UTC+2), Richard Hopkins-Lutz escribió:
I apologize if this has been asked before, or if it is in the documentation.

Is there a way to generate tiddlers and insert them into the code directly using an external script? Let's say I had a large batch of text files and I wanted to process them into individual tiddlers, is there some way to insert them directly into the code of a TW5 file as tiddlers? Is there documentation on how to do this?

RichardWilliamSmith

unread,
May 21, 2015, 8:18:34 PM5/21/15
to tiddl...@googlegroups.com
Hi Eric,

I wonder if it's possible to change the type of all these tiddlers at once using a list and button, similar to how you suggested in another thread for creating a list of new tiddlers?

Regards,
Richard

Richard Hopkins-Lutz

unread,
May 22, 2015, 2:51:04 PM5/22/15
to tiddl...@googlegroups.com
Hmm I was hoping to do it via a script on the command line and avoid the drag and drop method. This would let me use it to also export items from a DB into tiddlers.

RichardWilliamSmith

unread,
May 22, 2015, 10:54:42 PM5/22/15
to tiddl...@googlegroups.com
Hi Richard - I have found running TW under node to be relatively quick and simple. That way I have a single directory that contains a file for each tiddler and can write bash &/or perl snippets (inexpertly) to mash them as required - for example search and replace the 'type' field in all of them. Then save a single-page version either from the browser or using TW node commands.

The easiest workflow depends on what you're comfortable doing, of course - for example, if you use a script to pack your txt files into a single json object, you can drag it straight into the single-page TW.

If you want to avoid drag and drop altogether then I think you need to run the node version. 

Regards,
Richard

Neil Griffin

unread,
May 23, 2015, 2:39:18 AM5/23/15
to tiddl...@googlegroups.com
Richard,

My python module which Danielo sent the link to will allow you to do what you want as long as you can write a little python script.  If you prefer using the command line directly, you might still want to look at how my code is writing data into the TiddyWiki html file as you might be able to adapt the approach to a different language.

Neil.
Reply all
Reply to author
Forward
0 new messages