[TW5] Websockets and TiddlyWiki

225 views
Skip to first unread message

Jed Carty

unread,
Oct 29, 2017, 6:16:58 PM10/29/17
to TiddlyWiki
This is only for the node version of tiddlywiki and it is less polished than I would like, but it may be a week before I get back to working on it so I wanted to share it now.

For a while I have been using websockets with tiddlywiki to control my robot and as an interface between tiddlywiki and git. I finally got around to packaging the websockets portion up nicely into a plugin. Unfortunately I don't have a good demo application for this yet. I am working on setting up a git plugin as a demo but it isn't ready yet.

What this plugin lets you do is send messages between the browser and the node process.

This gives a framework for doing a few things that people have been asking for and discussing, including triggering bash or other scripts from a wiki, allowing edits to tiddler files (or adding tiddler files) outside of the wiki to affect the wiki without having to restart the node server, to search through folders of images or pdf files and create the .meta files to add them to a wiki, and, like I was doing with my robot, stream real time data into a wiki and use the wiki to control other systems on the computer. This can hopefully be used to make multi-user wikis by allowing the server to let each wiki know when a tiddler is being edited.

Now I just need to make some of it. It uses a two npm modules, websockets (the ws module) and it gets information it needs using the ip module. If you don't know what that means than this is probably not developed enough for you to play with yet.

I put the plugin on GitHub here https://github.com/OokTech/TW5-TiddlyWebSockets but without something else that uses it all you can do is make a button like this:

<$button>
Test
<$action-websocketmessage $type='test'/>
</$button>

and when you click the button the window with the node process should display 

{ messageType: 'test' }

in the console where the node process is running.

With this base worked out creating things that use this is relatively straight forward and as soon as I get a demo application set up I am going to write documentation for it. Hopefully this is something we can add into the node version of tiddlywiki after a bit of polishing.

coda coder

unread,
Oct 29, 2017, 7:51:10 PM10/29/17
to TiddlyWiki
This sounds extremely interesting.

Especially...

TonyM

unread,
Oct 29, 2017, 10:36:17 PM10/29/17
to TiddlyWiki
I will second that - Exxxxtreemly.

Riz

unread,
Oct 30, 2017, 12:07:20 AM10/30/17
to TiddlyWiki
Wow, this is an exciting development.

TonyM

unread,
Oct 30, 2017, 8:13:15 AM10/30/17
to TiddlyWiki
Jed,

I think there would be added value if your project facilitated a tiddler exchange or messaging system with the unit of exchange tiddlers or groups of tiddlers. I can discribe this idea more later.

I would think this could facilitate a loosly structured network of wikis inside or outside a nodejs wiki

regards
tony

Jed Carty

unread,
Oct 30, 2017, 9:05:58 AM10/30/17
to TiddlyWiki
Tony,

TWederation already does exactly what you describe.

Rob Hoelz

unread,
Oct 30, 2017, 12:08:55 PM10/30/17
to TiddlyWiki
This looks really handy! I have a few ideas for plugins that would be a lot easier based on this work =)

Out of curiosity, what do you intend your Git plugin to do? I'd be really interested in checking that out when you release it!

-Rob

Jed Carty

unread,
Oct 30, 2017, 12:25:31 PM10/30/17
to TiddlyWiki
Rob,

To make multi-user wikis work we (at OokTech) have been using wikis that only have tiddlers added to them or ignored by git and when we make changes we push them to a shared repo. So I am making a plugin to let me do that from within tiddlywiki. It could also pull plugins off of GitHub or publish them to git hub. It wouldn't be too hard to make a gui git client using tiddlywiki from it but I haven't found any gui clients that I actually like and I don't know how I would make a better one so I doubt I will do that.

You could also use git as an alternate way to serve plugins and tiddlers to other people.

Rob Hoelz

unread,
Oct 30, 2017, 3:13:38 PM10/30/17
to TiddlyWiki
Installing plugins directly from GitHub could be so helpful! Jed++

Jed Carty

unread,
Oct 30, 2017, 6:12:18 PM10/30/17
to TiddlyWiki
And now I have a demo that updates the wiki in the browser whenever a .tid file is updated. For the moment it only checks files in the tiddlers folder and I haven't tested it a lot so it may make  your computer come to life and take over the world or explode or something.

But yeah, it works.

I don't know if I like the name Gatekeeper but it was the first suggestion and I didn't feel like coming up with a better name. 
This won't work without the websockets plugin also.
Reply all
Reply to author
Forward
0 new messages