Exporting a list of tiddlers

1,943 views
Skip to first unread message

Patrick Pfeifer

unread,
Apr 6, 2015, 9:43:17 AM4/6/15
to tiddl...@googlegroups.com
I would like to export a list of tiddlers with a specific tag to a new wiki. How could I do that?

The reason why I am asking / my use case is the following: I have a wiki running on node.js on a personal web server. While travelling I can not access that server, so before I leave, I save a copy of that wiki to a local file and then make modifications there. Once I can connect to the server again, I would like to "merge" the mods that I made while travelling. Ideally, I could just drag and drop the html file (wiki) into the node.js hosted wiki page and click ok. However, when I do that, I get a _huge_ list of tiddlers "ready for import". But I have edited only one or to and do not want to import all the others. (Maybe in the meantime I might have made some edits on the server wiki ss well and I do not want them to be overwriten. So I really want to define the list of tiddlers to import from the offline copy myself, buth I do not want to manually untick all of those without modifications in that huge list. Thus the simplest thing would be to tag and export those that I _do_ want to merge and then import that whole list (new wiki) into the server wiki. But now now to export that list of tagged tiddlers??? I see lots of suggestions on http://tiddlywiki.org/#Export, but that all seems to be applicable to the legacy / classic version of TiddlyWiki. Is there an export plugin for TiddlyWiki 5? Or yould t^it be done from the command line with node.js ?

Cheers
Patrick

Eric Shulman

unread,
Apr 6, 2015, 3:33:48 PM4/6/15
to tiddl...@googlegroups.com
On Monday, April 6, 2015 at 6:43:17 AM UTC-7, Patrick Pfeifer wrote:
I would like to export a list of tiddlers with a specific tag to a new wiki. How could I do that?

1) Go to the $:/AdvancedSearch tiddler (click the magnifying glass next to the search input in the sidebar)
2) Open the "filter" tab
3) Enter a filter that selects the tiddlers you want, for example:
   [tag[exportThis]]
   (assuming you tagged the changed tiddlers with "exportThis"), or perhaps
or
   [!is[system]!sort[modified]limit[N]]
   (where N is the number of tiddlers you want to export... i.e., "the N most recently changed tiddlers")

4) After the search results are shown, notice the "export" button next to the search input field (the button looks like an open-topped box with an arrow pointing up).
5) When you click it, you will get a dropdown of choices for the export format.  Choose "JSON tiddlers file" to create and save a "tiddlers.json" file to your local filesystem.
6) Drag the tiddlers.json file into your TW5 document to import the tiddlers.

Q.E.D

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

"Inside TiddlyWiki: The Missing Manual"
Note: the IndieGogo funding campaign has ended,
but direct fundraising continues below...

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:

Patrick Pfeifer

unread,
Apr 7, 2015, 1:21:05 PM4/7/15
to tiddl...@googlegroups.com
Hello Eric

Woa ... _that_ simple !?? :-D ... great!!! Thanks a ton! I will put a link to your detailed instructions on my blog (not yet live...)!

Cheers
Patrick

PS: In the meanwhile I already ran and implemented "c pa"'s solution, which also works but is a lot more complicated - but quiet fun, if you have an inclination for programming and some time at hand.

Danielo Rodríguez

unread,
Apr 8, 2015, 1:09:14 PM4/8/15
to tiddl...@googlegroups.com
Hello Patrick,

If you are interested I wrote a plugin some time ago that helps with this kind of scenarios. Basically it allows you to batch select only those tiddlers that have been modified while importing.

Felix Küppers

unread,
Apr 8, 2015, 1:12:42 PM4/8/15
to tiddl...@googlegroups.com
Hi Danielo,

I am interested, could you provide a link? Thanks

-Felix

Danielo Rodríguez

unread,
Apr 8, 2015, 1:53:01 PM4/8/15
to tiddl...@googlegroups.com


El miércoles, 8 de abril de 2015, 19:12:42 (UTC+2), Felix Küppers escribió:
Hi Danielo,

I am interested, could you provide a link? Thanks

-Felix

Zaphod Beeblebrox

unread,
Jun 30, 2016, 12:06:02 AM6/30/16
to TiddlyWiki
Following this line of discussion/thinking, I have another situation:

I would like to make a TW available for download by folks, and then send out 'updates' in the form of new tiddlers bundled in a .json file that they can simply drag & drop into their TW.

I followed some instructions found here (can't find the post to link to at the moment) which said:

For those who are unaware of the standard method – this is my usual procedure:
1. Tag each of the tiddlers you wish to export with the tag 'Export'
2. Open the Filter tab of Advanced Search
3. Enter the filter expression '[tag[Export]]' (this should list the tiddlers you wish to export)
4. Click the little 'Export tiddlers' button next to the filter search box
5. Select 'JSON File'
6. Enter the name of your file, and save
7. Drag the saved file onto your other wiki
8. Import the tiddlers
9. If any of the tiddlers contained plugins, save and refresh


 This method works great, but when those tiddlers are subsequently imported into the users' TW, the "Export" tag remains and I'd rather not have that happen.

Isn't there a way (a macro, maybe?) that would enable you to see a list of all the tiddlers in your TW and pick and choose the one(s) to export by simply clicking a checkbox next to their title?

And, as a secondary question/problem I have, could I force the newly-imported tiddlers to open in an expanded position immediately after importation into the users' TW?
(I'm assuming there's no possibility of overwriting the Default tiddlers section of the users' Control Panel, so that those newly imported tiddlers would be the first thing seen upon a reload?)

Thank You in advance for any help :)

--Zaphod

PMario

unread,
Jun 30, 2016, 10:00:32 AM6/30/16
to TiddlyWiki
Hi,

You can just use a list of tiddlers without a tag eg: HelloThere Learning Features
If you use this string, you don't need tags to list them. ... It's more work, but would be a work around for the beginning.

The other possibility would be to modify the export button a bit. .... I'll need to do some tests :)

-m

Zaphod Beeblebrox

unread,
Jun 30, 2016, 6:59:29 PM6/30/16
to TiddlyWiki
Thank You so much, Mario - That solution does indeed do the trick :)

It is a bit cumbersome, but I don't mind - I can simply copy & paste the titles into a text file (or dummy tiddler) as I create each tiddler, then format and copy the whole statement into the Advanced Search box when ready to export my 'update' :)

The titles of the tiddlers (in my case) need to be enclosed in single quotes, as nearly all of them will include spaces (most will be movie titles, eg: 'Treasure Island (1972-G)' but that's a piddling thing.

--Zaphod

PMario

unread,
Jul 2, 2016, 8:29:06 PM7/2/16
to TiddlyWiki
On Friday, July 1, 2016 at 12:59:29 AM UTC+2, Zaphod Beeblebrox wrote:
Thank You so much, Mario - That solution does indeed do the trick :)

It is a bit cumbersome, but I don't mind - I can simply copy & paste the titles into a text file (or dummy tiddler) as I create each tiddler, then format and copy the whole statement into the Advanced Search box when ready to export my 'update' :)

The titles of the tiddlers (in my case) need to be enclosed in single quotes, as nearly all of them will include spaces (most will be movie titles, eg: 'Treasure Island (1972-G)' but that's a piddling thing.

--Zaphod

use this: [['Treasure Island (1972-G)']]

see: http://tiddlywiki.com/#WikiText:WikiText%20%5B%5BLinking%20in%20WikiText%5D%5D

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

I did have a closer look. ... A generic solution is a bit more complicated, as I thought.

It would be possible to change the jsontiddlers.js macro, but we would need to find a way to "temporarily" mark tiddlers for export, in a nice and generic way.
But I don't have an easy to implement idea atm. .. There may be a mechanism, that is similar to the import dialog, but for export. ...

Just as an info: responsible tiddlers: http://tiddlywiki.com/#%24%3A%2Fcore%2Fmodules%2Fmacros%2Fjsontiddlers.js:%24%3A%2Fcore%2Fmodules%2Fmacros%2Fjsontiddlers.js%20%24%3A%2Fcore%2Ftemplates%2Fexporters%2FJsonFile%20%24%3A%2Fcore%2Fmacros%2Fexport

-mario


Zaphod Beeblebrox

unread,
Jul 2, 2016, 9:35:08 PM7/2/16
to TiddlyWiki
Thank You for taking the time to investigate further :)

Your aforementioned solution will be more than satisfactory for my needs until such time as Jeremy or one of the other "Guru's" comes along and makes a ridiculously simple fix for the problem.

I took a cursory look at the javascript you linked to, but really can't do anything with it.  I can handle (most) HTML, (some) CSS, but anything higher than that and I'm just a script-kiddie, making niggling changes here and there.

I'm off now to tackle yet another problem: Flexbox divs in TiddlyWiki! (wish me luck :-P )

--Zaphod

Mark S.

unread,
Jul 3, 2016, 12:10:32 AM7/3/16
to TiddlyWiki
You can use a field like "exportme" with the value "yes" to select ones you want to export. Then use a configuration tiddler like:

$:/config/EditTemplateFields/Visibility/exportme


with value "hide" to hide the field from the average user.


You can write a <$list> with buttons that will let you quickly select items you want to mark. If you can't I'm sure someone here less sleepy than me can ;-)


Mark

Zaphod Beeblebrox

unread,
Jul 4, 2016, 9:14:28 AM7/4/16
to tiddl...@googlegroups.com
Thank You for this, Mark :)

I almost grasp the Field concept, and that would work to hide the label from the user.  Unfortunately, though, I haven't graduated to the point of understanding $lists in TW, yet.  I see much interesting discussion about them, but I haven't had to delve into the nuts and bolts of the thing in my use case, so far.

--Zaphod

Jan

unread,
Jul 4, 2016, 2:43:03 PM7/4/16
to tiddl...@googlegroups.com
Hi,
I made a little thing wich allows to export a chosen number of tiddlers last modified by the current user as an html file.
(Not a jason-file as you intended, but it works the same way...)
My aim was also to make collaboration a bit more easy so I called it Export for Teamwork.
I hope it helps for your usecase.
To make it work in the sidebar it was best to transclude it into another tiddler tagged $:/tags/SideBar.
If you do not want it in the sidebar you can delete it.

Cheers,
Jan
--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f81fe2fa-274a-48a2-951a-bf87fcd2423c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tiddlywiki.html

Mark S.

unread,
Jul 4, 2016, 3:37:25 PM7/4/16
to TiddlyWiki
Be sure to back up your files. This should allow you to put "yes" into an "exportme" field. Just copy it into a tiddler. Warning -- If you have a lot of tiddlers, the list might be long.

!! Select tiddlers for export
<table>
<tr><th>Title</th><th>Export?</th></tr>
<$list filter="[all[tiddlers]!is[system]!is[shadow]sort[]]">
<tr><td><$view field=title/></td><td align=center> <$checkbox field="exportme" checked="yes" unchecked=""/></td>
</tr>
</
$list>
</table>

HTH
Mark

Zaphod Beeblebrox

unread,
Jul 6, 2016, 9:08:35 AM7/6/16
to TiddlyWiki
Thank You, Jan, but I'm not quite sure what it is...?

I downloaded it, but upon bringing it up in either Firefox or Chrome, all I get is a blank white page.

--Zaphod

Zaphod Beeblebrox

unread,
Jul 6, 2016, 9:19:16 AM7/6/16
to TiddlyWiki
Well, Thank You, Mark! :)

Isn't it pretty? (gushes like a schoolgirl at the sight of all those little checkboxes :-P )

That does the selection trick very nicely - Once checked the tiddlers immediately appear in the SideBar under the current date, as being 'edited' or 'updated'.

Now, what is the string that I'd put in the Advanced Search box to tag all of them for export to .json?

The only 'improvement' I can think of would be to maybe narrow its scope down with a date-specific filter, like the last 3 days, 7 days, etc., but the whole date/time system in TW stymies me (I'd love to be able to easily decipher/change the creation date of tiddlers)

--Zaphod

Jan

unread,
Jul 6, 2016, 10:00:07 AM7/6/16
to tiddl...@googlegroups.com
Hi Zaphod,
The html contains the exported tiddlers. Drag it onto a Tiddlywiki to import and test it.
I t installs an exporter in a sidebar tab which exports a chosen number of tiddlers ( again in html format...) which can then be dragged to other Tws...
Cheers Jan.
--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Zaphod Beeblebrox

unread,
Jul 6, 2016, 10:09:11 AM7/6/16
to TiddlyWiki
Answering my own question, here :-P

Thought I'd throw it out there, for any folks who might also be looking for a solution.

In my use case, I want to distribute an 'update' to my users in the form of a .json-bundled pack of tiddlers, but would like those new tiddlers to open in an expanded state immediately upon them reloading their TW.  One way to do this is to override the Default Tiddlers section of the Control Panel and insert a list of the updated tiddlers we're adding.

I simply created a tiddler titled $:/DefaultTiddlers and listed the titles of each new tiddler (one per line, and remembering to enclose within brackets any titles that contained spaces).  This replaces any tiddlers that might have been there before, and is the same as if you'd gone into Control Panel and manually added them yourself.

--Zaphod

Zaphod Beeblebrox

unread,
Jul 6, 2016, 10:22:32 AM7/6/16
to TiddlyWiki
Ah, I see, now - I tried dragging the link from here onto the TW, but never got the Import ribbon...

Very clean and smooth - Thank You :)

Is there a way to have it export to .json, though? I'm afraid that some of my less technically-inclined users would (do what I just did :-P ) try to bring up the .html file in their browser, instead of importing it.

--Zaphod

Mark S.

unread,
Jul 6, 2016, 10:23:00 AM7/6/16
to TiddlyWiki
Try, in the advanced search filter tab:

[exportme[yes]]

Jan

unread,
Jul 6, 2016, 10:35:10 AM7/6/16
to tiddl...@googlegroups.com
Hi Zaphod,
This is a question for the Wizards...and a very useful modification.
Perhaps we put it up in the forum as a new Topic.
If anyone more skilled reads this,
What is the syntax to export Tiddlers with the download-message to something else than .html?

Cheers Jan

wimm

unread,
Jul 6, 2016, 4:02:34 PM7/6/16
to TiddlyWiki
there are some macros for exporting to json.
they include the exportbutton icon.

they require a filter as parameter to specify the tiddlers you want to export. the filter for a single tiddler is created with another macro to surround the tiddler title with [[]].

it also requires a lingoBase parameter

and a baseFilename

search for exportbu in advanced search tab shadow tiddlers

you are probably looking for macros/export which contains a action sendmessage tm-download...

it is not easy to convert into something else, there is a lot of dependencies embedded in download.js

(for my specific implementation I had to modify download.js as well, auto datetime signing name added filename from tiddler without url encoding for local file names, exporting story river to json ..)

hope this helps a little

Mark S.

unread,
Jul 6, 2016, 5:44:28 PM7/6/16
to TiddlyWiki
If you go into the filter tab under "advanced search" and enter a valid filter, a little export (up arrow) icon will appear next to the search box. Look closely -- it can be very hard to see.  Click on that and you will be offered the chance to download a csv file, an html file, a json file, or a tiddler file.

Unfortunately, if you choose to download as tiddlers, only ONE of the target tiddlers will be exported.

Mark

Jan

unread,
Jul 6, 2016, 5:44:33 PM7/6/16
to tiddl...@googlegroups.com
Hi Wimm!
Exporting the Storyriver to .json sounds seductive. I would be happy if
you could post this.
The construction is the following, is there an additional expression for
the exportbutton() to make it export a json-file

\define download-param()
\define saveTiddlerFilter() $(var-user-filter)$ +[sort[title]]

\define savingEmpty() yes

{{$:/core/templates/tiddlywiki5.html}}
\end

\define templatebutton()
<$button set="$:/temp/SaveMyNewTiddlersTemplate"
setTo=<<download-param>> to={{!!title}}>{{!!limit}}</$button>
\end

\define userexport()
[modifier[$(exportuser)$]!is[system]!sort[modified]limit[$(exportnum)$]]
\end

\define exportbutton() <$button message="tm-download-file"
param="$:/temp/SaveMyNewTiddlersTemplate" title="Export">Die neuesten
{{!!limit}} Einträge von {{$:/status/UserName}} exportieren</$button>

<$set name="exportnum" value={{!!limit}}>
<$set name="exportuser" value={{$:/status/UserName}}><br>
<$set name="var-user-filter" value=<<userexport>> >
<<templatebutton>>
</$set>
<<exportbutton>>
<hr>
<span title="Wieviele"><$edit-text tag="input" field="limit"
default="Wieviele?"/></span>
<$set name="exportnum" value={{!!limit}}>
<span title="Wer"><$edit-text tiddler="$:/status/UserName" tag="input"
type="text"/></span>
<$set name="exportnum" value={{!!limit}}>
<$set name="exportuser" value={{$:/status/UserName}}><br>
<$list filter=<<userexport>> ><br><<currentTiddler>></$list>
</$set>


cheers Jan

Jan

unread,
Jul 6, 2016, 6:21:57 PM7/6/16
to tiddl...@googlegroups.com
Hi Zaphod,
I made a new version with the exportbutton. It is all so easy if you know the correct spell. I renamed the tiddlers to avoid that they export themselves.
Cheers!
Jan
$__macros_Exporter.json
$__macros_Export for Teamwork.json

Zaphod Beeblebrox

unread,
Jul 7, 2016, 4:29:15 PM7/7/16
to TiddlyWiki
I knew it would be that simple :-P (I have absolutely NO experience/knowledge with $lists and such in TW...)

Thank You, Mark :)

--Zaphod

Zaphod Beeblebrox

unread,
Jul 7, 2016, 4:44:59 PM7/7/16
to TiddlyWiki
Well, that works slicker than snot on a doorknob!

And even with the ability to input how many tiddlers you'd like to export :)

Thank You, Sir :)

--Zaphod

wimm

unread,
Jul 8, 2016, 4:12:03 AM7/8/16
to tiddl...@googlegroups.com
Jan,

tiddler code to export StoryList (story river) to json      

<span title="export open / story river tiddlers"><$macrocall $name="exportButtonJSON" exportFilter="[list[$:/StoryList]]" lingoBase=""/>^^<$count filter="[list[$:/StoryList]]"/>^^ </span>

displays as:  J[^] + count of tiddlers in the river

tiddler for the exportButtonJason macro including the necessary tag is attached. (BTW lingo tiddlers are not available)

Njoy
WiM

$--core-macros-exportButtonJSON.json

wimm

unread,
Jul 8, 2016, 4:27:58 AM7/8/16
to TiddlyWiki
this tiddler will add a filter for exporting storylist storyriver in the the advanced search tiddler
however it exports only the first tiddler when using json export
$--core-Filters-StoryRiver.json

Birthe C

unread,
Jul 8, 2016, 5:40:06 AM7/8/16
to TiddlyWiki
Hi Wimm,

Testing this I get all the story tiddlers + your filter tiddler and $:/AdvancedSearch.


Birthe

wimm

unread,
Jul 8, 2016, 7:10:38 AM7/8/16
to tiddl...@googlegroups.com
Birthe,

which of the two are you referring to? 

1) for the exportbutton  J[^] story river to json 
     it is best to call it from a menu tab in the sidebar (like the open tab), or add a tag $:/tags/SideBar  or $:/tags/MoreSideBar   to the tiddler, and a caption field for the name on the new tab.

2) just the filter, 
   if those tiddlers are in the story river they are also exported to e.g. html

if you want to exclude $:/advancedsearch (which is in the story river when you select the filter)

you can replace 
[list[$:/StoryList]] 
by
[list[$:/StoryList]!search:title[advancedsearch]] 

Njoy
WiM

Birthe C

unread,
Jul 8, 2016, 9:09:12 AM7/8/16
to TiddlyWiki
Hi WiM,

Thank you! I had testet the filter. It is of course working nicely now ;-).


Birthe


Den fredag den 8. juli 2016 kl. 13.10.38 UTC+2 skrev wimm:
Birthe,

which of the two are you referring to? 

1) for the exportbutton  J[^] story river to json 
     it is best to call it from a menu tab in the sidebar (like the open tab), or at a tag $:/tags/SideBar  or $:/tags/MoreSideBar   to the tiddler, and a caption field for the name on the new tab.

wimm

unread,
Jul 8, 2016, 11:40:52 PM7/8/16
to TiddlyWiki
Zaphod, I like your idea to open the new tiddlers when you import an update. To automatically fill $:/DefaultTiddler from the story river you could use

<$button><$action-setfield $tiddler="$:/DefaultTiddlers" field="text" text={{$:/StoryList!!list}}/>init $:/DefaultTiddlers with all tiddlers in story river</$button>

I've added this button to my sidebar  in the Open tiddlers tab. Mayb later I'll add it to the icons tags/pagecontrol, but then I'll have to design an svg icon. We'll see

Or you can use a tiddler to generate the links all surrounded with double square brackets
<$list filter="your filter"><$text text="[["/><$view field="title"/><$text text="]]"/></$list>

Njoy
WiM

Zaphod Beeblebrox

unread,
Jul 10, 2016, 3:44:37 PM7/10/16
to TiddlyWiki
Well, that is very handy indeed, WiM! - Thank You :)

--Zaphod

Jan

unread,
Jul 12, 2016, 5:53:32 PM7/12/16
to tiddl...@googlegroups.com
Dear Exporters...
I made a new Version of the export-Tool implementing Wimm's Idea to export the storylist and my little tool to export the chosen number of tiddlers last modified by the current user.
They are both packed in the tabs of a SidebarTabExporter, you find it in the attached Json.
I had some problems adding a third way of exporting:
Opening all Tiddlers tagged by a chosen tag in the storyriver...to control and then export them with the Storylist exporter...
So...How do you do set the story to all tiddlers containing a secific tag entered in an inputfield while closing the others? Any Ideas...?
For everyone who just wants to use the plugin: Import and then delete $:/macros/Exporter/Story Experiment evrything else is working...
There is on other issue: You have to type really slow in the Input-fields, because otherwise the focus jumps away. Is there a cure for that behaviour?

Cheers jan
 





Am 30.06.2016 um 06:06 schrieb Zaphod Beeblebrox:
Following this line of discussion/thinking, I have another situation:

I would like to make a TW available for download by folks, and then send out 'updates' in the form of new tiddlers bundled in a .json file that they can simply drag & drop into their TW.

I followed some instructions found here (can't find the post to link to at the moment) which said:

For those who are unaware of the standard method – this is my usual procedure:
1. Tag each of the tiddlers you wish to export with the tag 'Export'
2. Open the Filter tab of Advanced Search
3. Enter the filter expression '[tag[Export]]' (this should list the tiddlers you wish to export)
4. Click the little 'Export tiddlers' button next to the filter search box
5. Select 'JSON File'
6. Enter the name of your file, and save
7. Drag the saved file onto your other wiki
8. Import the tiddlers
9. If any of the tiddlers contained plugins, save and refresh


 This method works great, but when those tiddlers are subsequently imported into the users' TW, the "Export" tag remains and I'd rather not have that happen.

Isn't there a way (a macro, maybe?) that would enable you to see a list of all the tiddlers in your TW and pick and choose the one(s) to export by simply clicking a checkbox next to their title?

And, as a secondary question/problem I have, could I force the newly-imported tiddlers to open in an expanded position immediately after importation into the users' TW?
(I'm assuming there's no possibility of overwriting the Default tiddlers section of the users' Control Panel, so that those newly imported tiddlers would be the first thing seen upon a reload?)

Thank You in advance for any help :)

--Zaphod
--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Exporter.json
Reply all
Reply to author
Forward
0 new messages