QA of my fix for tiddlywiki-plugins.tiddlyeditor

26 views
Skip to first unread message

Gary Hodgson

unread,
Apr 29, 2013, 10:45:35 AM4/29/13
to tidd...@googlegroups.com
Hi,

The recent upgrade to tiddlyweb 1.4.8 seems to have broken the tiddlyeditor plugin.  I have had a go at fixing it, but I suspect my fix isn't optimal.

A bit of debugging showed that if the tiddlyeditor was defined in system_plugins before tiddlywebwiki then the link to the editor is not shown, and if it is placed after tiddlywebwiki then the link is there, but tries to find a corresponding recipe (i.e. 404,unable to get recipe tiddlyeditor).

My (hackish) solution was to split the plugin into it's two constituent parts, tiddlyeditor injects the "/tiddlyeditor" app, and a new plugin, called tiddlyeditor_footer and placed after the tiddlywebwiki entry, adds the footer to the serializer.

This works, but as I'm not yet up to speed on the inner workings I'm sure there is a better way. Can anyone enlighten me?

(The split is pretty obvious so I haven't included the code, but I can throw it into a gist if anyone needs it)

Thanks,
Gary

chris...@gmail.com

unread,
Apr 29, 2013, 11:30:27 AM4/29/13
to tidd...@googlegroups.com
On Mon, 29 Apr 2013, Gary Hodgson wrote:

> The recent upgrade to tiddlyweb 1.4.8 seems to have broken the tiddlyeditor
> plugin. I have had a go at fixing it, but I suspect my fix isn't optimal.

This was partially the addition of "friendlywiki" in tiddlywebwiki,
which upsets the addition of new route/uri mappings, such that
tidldywebwiki needs to be late in the system_plugins list.

The other half is the removal of the HtmlPresenter middleware which
tiddlyeditor presumably used to add the footer.

> My (hackish) solution was to split the plugin into it's two constituent
> parts, tiddlyeditor injects the "/tiddlyeditor" app, and a new plugin,
> called tiddlyeditor_footer and placed after the tiddlywebwiki entry, adds
> the footer to the serializer.

Does the tiddlyeditor_footer have to go after tiddlywebwiki? If it
does that would be because of tiddlywebplugins.atom (which adjusts
the html serialization and may be clobber changes).

> This works, but as I'm not yet up to speed on the inner workings I'm sure
> there is a better way. Can anyone enlighten me?

It sounds generally correct, but probably some tidying up in the
details.

> (The split is pretty obvious so I haven't included the code, but I can
> throw it into a gist if anyone needs it)

If you could throw it up in a gist I'll adapt it into a new release
of tiddlyeditor.

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

Gary Hodgson

unread,
Apr 30, 2013, 3:35:51 AM4/30/13
to tidd...@googlegroups.com
Hi Chris,

You already updated the tiddlyeditor plugin from HTMLPresenter to Serialisation a little while ago (thanks).

I disabled friendlywiki in the config and the original editor works once again (when it is defined after tiddlywebwiki).

I created a gist with the split solution in case it is still relevant: https://gist.github.com/garyhodgson/5487142

Regards,
Gary 

chris...@gmail.com

unread,
Apr 30, 2013, 5:04:26 AM4/30/13
to tidd...@googlegroups.com
On Tue, 30 Apr 2013, Gary Hodgson wrote:

> You already updated the tiddlyeditor plugin from HTMLPresenter to
> Serialisation a little while ago (thanks).
>
> I disabled friendlywiki in the config and the original editor works once
> again (when it is defined after tiddlywebwiki).
>
> I created a gist with the split solution in case it is still relevant:
> https://gist.github.com/garyhodgson/5487142

Thanks. This confirms what I was saying about needing to be after
the atom plugin.

Given that tiddlywebwiki must be present in order for tiddlyeditor
to work, one option that would allow for just one plugin and still
allow the friendlywiki option would be to subclass
tiddlywebplugins.atom.htmllinks instead of
tiddlyweb.serializations.html when creating the editor serialization
that adds the _footer.

Is that worth doing?

Gary Hodgson

unread,
Apr 30, 2013, 6:21:36 AM4/30/13
to tidd...@googlegroups.com
I attempted modifying tiddlyeditor so that the Serialiser inherits from tiddlywebplugins.atom.htmllinks, as you suggested, but it seemed not to resolve the problem.  Also, I don't know the architecture well enough to say whether such solution is worth doing, but my gut tells me that inheriting from serializations.html sounds more intuitive than from atom.htmllinks - even if the latter had worked.

An alternative solution (which keeps the tiddlyeditor in tact) is to disable friendlywiki and use the urls plugin instead.
Reply all
Reply to author
Forward
0 new messages