Trac <=> TiddyWiki connector

7 views
Skip to first unread message

awilkins

unread,
Jun 21, 2008, 3:12:36 PM6/21/08
to TiddlyWikiDev
My use case :

I'm using Trac as a means to get my users to self-document their shiny
new software as much as possible ; with a few tech-savvy users this is
both less wearing on me and more in tune with their needs.

Alas, the wiki is served on an internal server that is not going to be
exposed to the scary world of the Greater Internet any time soon, and
I have a subset of users who are contractors ; and contractors are not
permitted VPN access because of our arcane security rules.

Hence I want a way to get the wiki to them as well. My present stop-
gap measure is to use the trac-admin script to dump the pages to
files. This is obviously degrades the experience somewhat and scares
users who don't like reading WikiText.

Enter a converter from TracWiki to TiddlyWiki. Or at least, the idea.

So .. Trac => Tiddly (as TracWikiText, an ingrained habit :-) )

1. Squeeze the pages out of Trac
* Worst case, you could do what I've done and dump them.
* A much better idea would be a way of scraping them off the live
server.
1. Make TracWikiText appear correctly in TiddlyWiki
* Convert TracWikiText to TiddlyWikiText
* '''OR'''
* Convince TiddlyWiki to display TracWikiText correctly
1. Convert each page into a Tiddler
1. Import into target TiddlyWiki

And optionally, Tiddly => Trac ; it might be nice for my remote users
to be able to make edits and send them back to me.

So, initial research ; I'm going to have a look at the XMLRPC
interface for Trac, a WikiText conversion/compatibility matrix needs
doing, etc.

Possibly back with more posts later. Any additional contribution would
be excellent ; I've already had interest from someone on the freenode
IRC channel.

FND

unread,
Jun 21, 2008, 6:53:03 PM6/21/08
to Tiddly...@googlegroups.com
> Enter a converter from TracWiki to TiddlyWiki.

That sounds very interesting - there's been talk of this before (e.g. it
would help us manage tickets), but I believe Trac's missing a web API.
However, the XML-RPC plugin* might offer that - I can't really tell.

> * Convince TiddlyWiki to display TracWikiText correctly

You can teach TiddlyWiki to interpret different wiki markup. Martin has
written formatters for a number of wiki engines:
http://martinswiki.com
There's also some information on the community wiki:
http://www.tiddlywiki.org/wiki/Dev:Formatter
Since Trac's wiki markup is fairly similar to TiddlyWiki's, this
shouldn't be too hard.

> 1. Convert each page into a Tiddler
> 1. Import into target TiddlyWiki

If the XML-RPC plugin does indeed provide an interface for accessing the
Trac data, you could write an adaptor. Again, Martin's and the community
wiki have examples and more information:
http://www.tiddlywiki.org/wiki/Dev:Server_Adaptor_Mechanism

> And optionally, Tiddly => Trac ; it might be nice for my remote users
> to be able to make edits and send them back to me.

If the API supports it, this should be possible with the adaptor.

Looking forward to hearing about your progress!


-- F.


* http://trac-hacks.swapoff.org/wiki/XmlRpcPlugin

HeX

unread,
Jul 9, 2008, 4:04:05 AM7/9/08
to TiddlyWikiDev, adrian....@gmail.com
Hi Adrian,

are there any new on this? I also would love to see such an interface
to Trac.

/HeX

Adrian Wilkins

unread,
Jul 9, 2008, 8:15:44 AM7/9/08
to HeX, TiddlyWikiDev

I've been a bit preoccupied, but I still intend to have a crack at it so
I can support my extra-network users with a user manual.

My initial impression of the XMLRPC interface for Trac is that it easily
supports enough features to export a TracWiki to a TiddlyWiki (which is
my initial goal, even though 2-way syncing is obviously desirable). The
TracFormatter by Mr Budden is obviously a large plus here. I've only
just dicovered that to install a plugin you just make a tiddler out of
it... so I'll play with that first. (seems to work nicely)

I've not had a proper crack at XMLRPC over JavaScript, but it seems easy
enough.

My needs would probably be supported well by a plain TracFile import
(since I'm the Trac admin and can get it dumped to disk), but the XMLRPC
solution seems a lot more elegant.

HeX

unread,
Jul 9, 2008, 9:02:03 AM7/9/08
to TiddlyWikiDev
Wow I was completely oblivious of Martin's plugin. It's really awesome
and with a connection via XMLRPC that would make my day :)

FND

unread,
Jul 9, 2008, 9:03:50 AM7/9/08
to Tiddly...@googlegroups.com
> My initial impression of the XMLRPC interface for Trac is that it easily
> supports enough features to export a TracWiki to a TiddlyWiki (which is
> my initial goal, even though 2-way syncing is obviously desirable).

Same here (I suppose if it works for TracWiki, it works for TracTickets).

> I've not had a proper crack at XMLRPC over JavaScript, but it seems easy
> enough.

If you could provide us with some details on how to get started, maybe
we can chip in a few bits of code and general guidance.


-- F.

FND

unread,
Jul 21, 2008, 12:54:34 PM7/21/08
to Tiddly...@googlegroups.com
>> I've not had a proper crack at XMLRPC over JavaScript, but it seems easy
>> enough.
>
> If you could provide us with some details on how to get started, maybe
> we can chip in a few bits of code and general guidance.

FWIW, I (only) just realized that we'll need some kind of XML-RPC
message builder for JavaScript:
http://www.google.com/search?q=JavaScript%20XML-RPC
Then we could access Trac like so:
http://trac.tiddlywiki.org/xmlrpc
http://trac.tiddlywiki.org/login/xmlrpc
From there it should be fairly easy.
However, I don't really know a lot about how XML-RPC works...


-- F.

Martin Budden

unread,
Jul 23, 2008, 5:30:31 AM7/23/08
to Tiddly...@googlegroups.com
The JSP adaptor uses RPC and could be used as a starting point for the
Trac adaptor. See:

http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/adaptors/JSPWikiAdaptorPlugin.js

Martin

2008/7/21 FND <FN...@gmx.net>:

FND

unread,
Jul 23, 2008, 6:08:09 AM7/23/08
to Tiddly...@googlegroups.com
> The JSP adaptor uses RPC and could be used as a starting point for the
> Trac adaptor.

Oh - I didn't know that, so I've come up with a simple XML-RCP plugin:
http://tinyurl.com/5k879p
(http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/XMLRPCPlugin.js)

Here's some sample code:
---------------
var url = "http://trac.tiddlywiki.org/xmlrpc";

var method = "ticket.query";
var params = [{
type: "str",
value: "owner=FND"
}]

xmlrpc.request(url, config.macros.XMLRPC.diplayResults, method, params);
---------------

The output is not being processed yet, and there are still a few bits of
XML-RPC functionality missing (e.g. complex data types for parameters).

I've already spent more time on this than I had intended, so any
contributions would be very welcome...


-- F.


[1] http://trac.tiddlywiki.org/xmlrpc
[2] http://trac-hacks.swapoff.org/wiki/XmlRpcPlugin

Paul Downey

unread,
Jul 23, 2008, 6:16:16 AM7/23/08
to Tiddly...@googlegroups.com
On 23 Jul 2008, at 11:08, FND was heard to utter:

> Oh - I didn't know that, so I've come up with a simple XML-RCP plugin:
> http://tinyurl.com/5k879p
> (http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/XMLRPCPlugin.js
> )

nice! sounds like one step away from a MT/Wordpress API plugin
and TiddlyWiki as a MT/Wordpress/Blogger client, assuming someone
hasn't already done this?

http://codex.wordpress.org/XML-RPC_Support

of course AtomPub would be the cleaner way to do this,
but not currently mainstream:

http://www.intertwingly.net/blog/2007/08/30/WordPress-2-3-AtomPub

Paul
--
http://blog.whatfettle.com

FND

unread,
Jul 23, 2008, 8:19:31 AM7/23/08
to Tiddly...@googlegroups.com
> nice!

Well, I don't know about that (e.g. it currently uses RegEx instead of
proper XML parsing)...

> sounds like one step away from a MT/Wordpress API plugin
> and TiddlyWiki as a MT/Wordpress/Blogger client, assuming someone
> hasn't already done this?

Well, halfway through I was reminded of TiddlyBlogger:
http://boycook.wordpress.com/2007/11/05/tiddlyblogger-updated/
http://jayfresh.tiddlyspot.com/#BlogSetup%20BlogPlugin

While I personally don't care too much about WordPress right now (I just
really want to import tickets from Trac), it shouldn't be hard to make
TiddlyBlogger use this more generic (though incomplete) XML-RPC library.


-- F.

Reply all
Reply to author
Forward
0 new messages