[TW5] Walkthrough to getting started writing simple plugins

318 views
Skip to first unread message

David Johnston

unread,
Sep 12, 2013, 5:10:49 AM9/12/13
to tiddly...@googlegroups.com
Firstly this simple walkthough was inspired by a conversation with Tobias Beer in this post. https://groups.google.com/forum/#!topic/tiddlywikidev/s20g1snJQTY

Any detailed advice on how to tackle getting such a plugin up and running on the tw5 front is very welcome, e.g. a step 1 to 10 kinda tutorial that explains the process roughly outlined with whatever details are rather essential.

I realised that someone should have a go at doing this.

Secondly, I am not a technical writer, so if you find problems please don't hesitate to comment so I can amend the walkthrough and improve it. 

----------------------------------------
 
To get started one must first install Node.Js on your computer and download TW5 from Jeremy's github repository. There are many ways to do these things, this was the way that worked for me when I tried it.

1. Download and install Node.JS from http://nodejs.org/
2. If using a Windows computer, download and install github for Windows .. http://windows.github.com/ or Cygwin ... http://www.cygwin.com/ .. (The github or cygwin  install lets you run the .SH scripts that Jeremy supplies for building new TW5 plugins and running TW5 as a local server.)
3. Download the TW5 repository at github using http://github.com/Jermolene/TiddlyWiki5/archive/master.zip .. (later on you can use Github properly to do this, but more on using github later perhaps)
4. Create a Tiddlywork directory in a place you are comfortable with (I chose the root of my D: drive) ... such as D:\tiddlywork
5. Copy the master.zip file you downloaded in step 4. to D:\tiddlywork
6. Extract the zip file you downloaded into D:\tiddlywork
7. You should end up with a directory called D:\tiddlywork\TiddlyWiki5-master\ ... I renamed that to d:\tiddlywork\TiddlyWiki5
8. While in the D:\tiddlywork directory make another folder called d:\tiddlywork\jermolene.github.com ... you could call this whatever you want, however that would mean altering some scripts (unadvisable at this stage).
9. Go to the start menu and under Node.js, click on Node.JS command prompt.
10. Move to the D:\tiddlywork\TiddlyWiki5\ Directory using cd D:\tiddlywork\TiddlyWiki5\
11. If github is installed you can then enter bld.sh   this will build all the TW5 basic Tiddlywiki's over in ... d:\tiddlywork\jermolene.github.com
12. If using Cygwin then the command to do this is sh bld.sh you need to precede all sh type files with the sh command if using cygwin
13. To test tw5 in server mode, run serve.sh and then go to a browser and enter http://localhost:8080/ to view a tiddlywiki running as its own webserver.

If anyone else would like to test this and report back I can amend or add to it as required. It is all from memory as I am at work at the moment.

I will try and add to this with instructions on making your first simple plugin example walkthrough later on.

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

Jeremy Ruston

unread,
Sep 14, 2013, 12:31:05 PM9/14/13
to TiddlyWikiDev
Thanks for those notes David, much appreciated. I'd welcome pull requests for documentation updates like this,

Best wishes

Jeremy


--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Tobias Beer

unread,
Sep 14, 2013, 7:33:06 PM9/14/13
to tiddly...@googlegroups.com
Ah, been wanting to walk through it and reply to this post, but lost sight of it. Anyhow, thanks a ton, David.

- tb

Ton Gerner

unread,
Sep 16, 2013, 4:39:39 PM9/16/13
to tiddly...@googlegroups.com

Hi David,

New to TW5, node.js, github etc. I tried to follow your walkthrough (Windows 7 32-bit)
After installing github I wondered if I had to sign up; I didn't.
Entering bld.sh in the node.js command prompt did not build anything; the command was not recognized.
Error:
Windows can't open this file ...
What do you want to do:
* Use the web service to find the correct program
* Select a program from a list of installed programs


Rebooting the PC did not help.
I am stuck and hope you can help.
Thanks in advance,

Ton

David Johnston

unread,
Sep 16, 2013, 4:52:41 PM9/16/13
to tiddly...@googlegroups.com
Hi Ton,

Firstly, thanks for trying out the walk through. I appreciate the feedback and hopefully anything we find can help improve it :)

If bld.sh didn't run then you don't have anything loaded that can execute the shell script. So first thing we need to do is fix that. 

I used Cygwin instead of github for windows. Lets try that first see if it solves the problem.

Go to Cygwin and download and install please.

Once that is done, go to the node.JS command prompt again and enter the command: -

sh

it should return with something like: -

sh-4.1$

If it doesn't then the shell (sh) command is not in your system path and we can get round to fixing that.

If it does respond like that, then you are almost there :)

first type: -

exit

This will drop you back to the Node.JS command prompt.

from that position follow from step 10. in the list above  .. and when it comes to running bld.sh you will need step 12 instead of 11 as you are using CYGWIN.

In step 13 you will need to add SH in front of the server command .. like this: -

sh serve.sh

Hope this helps. If there is a problem I will be around for the next 30 mins or so before heading to bed.

David




Ton Gerner

unread,
Sep 17, 2013, 6:53:40 AM9/17/13
to tiddly...@googlegroups.com
Hi David,

Thanks for the quick reply. I didn't expect such a fast reaction, so I shut down my PC yesterday.

Yesterday I installed Cygwin as well (I did not mention it in my post); entering sh bld.sh in the node.js command prompt resulted in:
'sh' is not recognized as an internal or external command, operable program or batch file.
That was already hinting at a path problem but I did not realize that.

Via the start menu I found the Cygwin terminal so the shell command must be there.
Cygwin was installed at c:\cygwin
Changing to the c:\cygwin\bin directory in the command prompt, sh resulted in:
sh-4.1$

The shell is there and works; so for sure it is a path problem.

I appended C:\cygwin\bin; to the path and after a reboot it works: sh bld.sh builds all the basic TiddlyWiki's.
Now TW5 in server mode works.

Curious about the Github route, I searched my hard disk for other 'sh.exe' files and found the "Github version" (thanks to Everything [1]) at:
C:\Users\"username"\AppData\Local\GitHub\PortableGit_015aa71ef18c047ce8509ffb2f9e4bb0e3e73f13\bin
This sh.exe responded with:
sh.exe"-3.1$

Please add some notes about expanding the path.
sh.exe can easily be found with Everything [1] when using Windows; I use the portable version of it.

Many thanks for your walkthrough and the help.

Ton

David Johnston

unread,
Sep 17, 2013, 10:33:30 AM9/17/13
to tiddly...@googlegroups.com
Thanks Ton for the feedback.

I am pleased you got everything working and I will add a section on checking to see if SH is in the path.

David

Shankar Swamy

unread,
Nov 9, 2015, 5:29:17 PM11/9/15
to TiddlyWikiDev

Could David or someone knowledgeable confirm that the steps mentioned by David still work.  That posting is about a couple of years old and I would like to confirm it is still good.  Or if you know of an updated version or any other relevant documents you could list, I would appreciate that.

Thanks!

Cheers; 'best,
shankar

BJ

unread,
Nov 10, 2015, 3:19:07 PM11/10/15
to TiddlyWikiDev

Shankar Swamy

unread,
Nov 10, 2015, 10:53:37 PM11/10/15
to TiddlyWikiDev

BJ, Thanks!  This is wonderful.  Now that I know it exists, may be some day I will even consider switching to TW5 from TWC :-).

Cheers; 'best,
shankar
Reply all
Reply to author
Forward
0 new messages