Best practices when modifying tiddlyweb

26 views
Skip to first unread message

Gary Hodgson

unread,
Apr 25, 2013, 11:09:43 AM4/25/13
to tidd...@googlegroups.com
Hi guys,

I am starting to slowly develop parts of what might be considered core parts of TiddlyWeb, for our company's instance, and I am a little unsure how best to integrate my changes. 

As an example, my initial mod is in BinaryTiddlersPlugin - adding filename functionality (i.e. the name of the file is remembered and not replaced with the tiddler title).  Would you expect these changes to go into the source project (i.e. the js files in tiddlywebwiki) or as instance modifications to the actual Tiddler, and somehow deployed that way?

The, slightly related, follow-up question is how do people usually develop on tiddlyweb itself? Do you modify the project and then build and deploy a local package using pip? Or is there another way? (I ask because running pip bundle seems to take quite a while to run).


I've had a cursory search for development notes here and on tiddlyspace, my apologies if I overlooked any guides that already exist.

Cheers,
Gary

chris...@gmail.com

unread,
Apr 25, 2013, 11:55:54 AM4/25/13
to tidd...@googlegroups.com
On Thu, 25 Apr 2013, Gary Hodgson wrote:

> I am starting to slowly develop parts of what might be considered core
> parts of TiddlyWeb, for our company's instance, and I am a little unsure
> how best to integrate my changes.

I think we talked about this in person but probably what you want to
do is create your own tiddlyweb plugin that represents the company
application (sometimes called a vertical). This would be similar to how
tiddlywebwiki is an application of tiddlyweb that assembles the
necessary tiddlyweb and tiddlywiki parts, or how
tiddlywebplugins.tiddlyspace is an application of tiddlyweb that does
the same (including tiddlywebwiki).

There's a brief, but very old, plugin tutorial which explains some
of the ways to get at functionality:

http://tiddlyweb.tiddlyspace.com/TiddlyWeb%20Plugin%20Tutorial

However inspecting the tiddlywebwiki and tiddlyspace source is
probably going to be most informative. The config.py, instance.py
and setup.py define and control the structure of the plugin and
dependencies.

Other resources that are important would be:

https://pypi.python.org/pypi/tiddlywebplugins.imaker
https://pypi.python.org/pypi/tiddlywebplugins.ibuilder

These are used to package up default resources that you need with
your plugin.

Quite some time ago and thing called pluginmaker was created which
demonstrates the basic structure when making a tiddlyweb plugin:

https://github.com/tiddlyweb/pluginmaker

> As an example, my initial mod is in BinaryTiddlersPlugin - adding filename
> functionality (i.e. the name of the file is remembered and not replaced
> with the tiddler title). Would you expect these changes to go into the
> source project (i.e. the js files in tiddlywebwiki) or as instance
> modifications to the actual Tiddler, and somehow deployed that way?

First you should determine if there's any chance that your
functionality could be useful to other people and integrated into
the existing plugin as an option. If so, then I'd recommend forking
it and submitting the changes back to the maintainer so that
everyone can benefit.

If not then the next thing to determine is if your additional
functionality can be accomplished by subclassing or monkey-patching
the existing thing. If so, then I would write the code in that way
and include it in your vertical.

If not then I would have your new version in your vertical in such a
way that when your vertical is installed or updated it clobbers the
existing plugin.

> The, slightly related, follow-up question is how do people usually develop
> on tiddlyweb itself? Do you modify the project and then build and deploy a
> local package using pip? Or is there another way? (I ask because running
> pip bundle seems to take quite a while to run).

Does the above information answer this question at all? If not,
shout out with some more concrete questions and I'm happy to provide
some guidance. At this point I'm not entire following whether you're
trying to create TiddlyWiki or TiddlyWeb side functionality (or
both) nor the development process you're following.

--
Chris Dent http://burningchrome.com/
[...]

Gary Hodgson

unread,
Apr 26, 2013, 4:49:57 AM4/26/13
to tidd...@googlegroups.com
Hi Chris,

Thanks for the information, from initial reading it seems that going the way of a vertical would work best for us. This would overcome the confusion I had regarding versioning and whether to modify the source files in tiddlywebwiki, etc.

Your answers also address my question about development process I think.  I was confused as to how best to redeploy my modifications, e.g. I update part of the tiddlywebwiki source, how best to deploy it to the python site_packages.

I'll read a bit more :)


Gary.
Reply all
Reply to author
Forward
0 new messages