> Hi -
So at some point I suspect somebody else will join in the fray here,
but I'm around, and you keep asking interesting questions, so here
come some comments. This message is huge so I'll probably skip some
parts...
> I find TiddlyWiki / TiddlyWeb / TiddlySpace to be very well-designed
> for several reasons:
There's a timetable on these things and different people:
* TiddlyWiki: Jeremy Ruston, 2004
* TiddlyWeb: Me, starting in 2007, based on a design worked out with
me, Jeremy, Martin Budden, quickly followed by lots of input from
FND. At the end of this message I posted some of the logic behind
TiddlyWeb (at the paragraph beginning "Which leaves me to talk a bit
about TiddlyWeb"):
http://groups.google.com/group/tiddlywiki/msg/e0291462d115f729
* TiddlySpace: Osmosoft, starting in 2010
http://osmosoft.com/
At each stage there's been a different set of goals, and different set
of technical challenges and environments. By which I mean the forces
impacting the design have been different.
For example, in 2007 when I started TiddlyWeb I was pretty excited after
successfully establishing the REST API for Socialtext, in Perl, so
I was keen on being uptight about HTTP and about code structure.
Later, with TiddlySpace we've taken a more pragmatic and sometimes
hurried approach to things. In either case the techniques used needed
to fit in with at least some of the precedents set by TiddlyWiki.
Just in the past few months we've been more actively exploring ways of
being outside some of those TiddlyWiki precedents (more on that
below).
The constant, though, is the idea of the tiddler.
> (a) It Just Works
>
> - very important in these days of bloated software which often has
> broken dependencies
I'm glad you still think this, despite your ordeal last night.
> (b) It's tiny and fast (at least after the initial page load -
> is there any way to optimize this, eg with nginx or gzip?)
Each of the things you GET from a tiddlyweb can be had in a variety of
formats using content negotiation. If you've got TiddlyWebWiki
installed the available formats are html, plain text, json, as a
TiddlyWiki, and Atom.
Most of these are receptive to being gzipped. tiddlyspace.com uses
mod_deflate on outgoing content.
> - "Speed is a feature" they say these days.
This is a big deal once you start having a large tiddlywiki with lots
of tiddlers in it. There have been lots of discussions about options
for "lazy" or "dynamic" loading of tiddlers in TiddlyWiki.
> - Where's the code ??
> There's almost nothing in the ~/home/tiddlyspace/tiddlyspace_instance
> directory!
There's the two sides of the code, the stuff doing the server stuff:
* http handlers
* storage handling
* authentication and authorization handling
* recipe processing
and whatever is on the client side. If you get the tiddlywiki
representation of some tiddlers then it is the TiddlyWiki HTML file
with its embedded Javascript, but there are lots of other options. My
space, http://cdent.tiddlyspace.com/ is the HTML representation of a
single tiddler, with some loaded javascript to enhance the
presentation. No TiddlyWiki.
The bulk of the server-side code is located wherever your system
installs extra Python libraries, something like
/usr/lib/python2.5/site-packages
> - Is all the logic really still in the JavaScript in the single file
> sent to the browser?
> (If so, are there any guides to understanding this JavaScript better?)
When TiddlyWiki is being used with TiddlyWeb, then the Javascript in
the tiddlywiki does the PUT and GET handling when you do edits, but
that stuff is not in a TiddlyWiki by default, it is added as a
(client-side) plugin. The tiddlywebwiki client code is here:
https://github.com/tiddlyweb/tiddlywebwikiclient
and is added to the tiddlywebwiki python package when it is built.
> Question:
> Is all the "data" in MySQL now, for TiddlySpace?
> Or is stuff still stored in the filesystem like it is in TiddlyWeb?
In MySQL, by default.
TiddlyWeb has an architectural bit called the StorageInterface. When
an entity is persisted or required from the persistence layer, a
generic method is called. Configuration determines which
implementation of the StorageInterface is then called to do the
handling. The default "store" in TiddlyWeb is called "text". In
TiddlySpace the default store is called "tiddlywebplugins.mysql2". On
tiddlyspace.com the store is tiddlywebplugins.caching which wrap any
StorageInterface with memcached. It wraps the mysql2 store. There are
lots of storage implementations out there, including ones that make it
possible to use different stores for different bags, or store the same
stuff in multiple stores.
> This seems similar to LISP programs where everything is a list -
> including LISP programs themselves.
This comment (and similar on smalltalk) has been said about TiddlyWiki
quite often. Someone once called it a quine.
> I would be curious to hear any other ideas about reflection
> and how it has been implemented in TIddlyWiki and TiddlyWeb -
> and what's the best way to leverage it to Get Things Done.
This is one of the topics that comes up quite regularly on the
tiddlywiki list (referenced above).
> Question: is there a way of regarding a Bag or a Recipe
> as also being a Tiddler?
Not as things are currently implemented. We talked about doing this
sort of thing while talking the design but it was decided that at some
point the possible abstractions had to be nailed down and the
different meanings of the three entities was important to reify in a
concrete fashion.
This is not to say that you couldn't represent either a recipe or bag
as a tiddler, on the client side, and then adapt it appropriately.
> I suspect there might be, because a lot of TiddlyWeb's underlying
> functionality
> does seem to be exposed via the standard web interface -
> in the form of Tiddlers, which seem to be the fundamental "entity" in
> TiddlyWeb,
> along with Bags and Recipes.
The things you can GET from a default instance are:
* a single tiddler, bag or recipe
* a collection of tiddlers, bags or recipes, optionally filtered
tiddler collections come from:
* a processed recipe
* the contents of a bag
* a search result set
* the revisions of single tiddler
The last two are optional. A store may choose not to implement search
or revisions.
> Question: How do Bags and Recipes relate to popular notions
> about "routing" and "MVC" and "REST" in the web programming world?
I'm not sure I understand this question. You might look at this and
then restate what you're asking:
http://tiddlyweb.peermore.com/wiki/#%5B%5BHTTP%20API%5D%5D
> At the semantic level there seems to be this isomorphism or
> equivalence
> between a Tiddler on the webpage and a File in the filesystem.
Yes, this is something that came up on the list recently:
http://groups.google.com/group/tiddlyweb/browse_frm/thread/1c224b4f5c4a4c93/ff5d3f49ff4c322e
> I understand that a Tiddler normally is just a header and a body, or a
> key and a value -
> but within that value there could be a certain structure.
The usual way of achieving such things, since TiddlyWeb came along and
made field more "core", is by using the 'fields' field of the tiddler to
have a dictionary attached to the tiddler, putting the structure in an
adjacent field, not the text attribute.
> Question: Is it common practice to define other, customized types of
> Tiddlers
> corresponding to other types of objects in the problem domain,
> where each type of Tiddler could have a particular "signature" ie set
> of field(-type)s?
This is done yes.
> If so, are there special facilities for mapping the various types of
> Tiddlers
> to various types of HTTP content or MIME types?
There are what are called binary and pseudo-binary tiddlers, which have
a 'type' field set to a MIME type, with the text attribute containing
the binary content. There's more to say on this topic, but I'll leave
that for more detail later, also look on tiddlyweb.peermore.com
This 'type' stuff is a TiddlyWeb thing, not quite a TiddlyWiki thing.
> In my particular case, I would like to create an online wiki for
> teaching languages,
> and I would like to include some audio and video content (not just
> text content).
Yes, this is possible with binary tiddlers. The tiddlers just "become"
the binary content, PUT to the server into a bag with a title.
> What I mean is, in its final form here,
> the JavaScript can be rather low-level and hard to figure out what it
> does.
Yes, I agree.
> If there were a high-level specification somewhere of the various bits
> of JavaScript embedded in the page,
> this could be very interesting to study.
There's an ongoing discussion about this in the [tiddlywiki] group
right now.
> Question: What is the MySQL being used for in TiddlySpace?
Speed. The volume of content on tiddlyspace and the type of activities
requires indexes across all the attributes which make up a tiddler.
And there is fulltext indexing of the text field on the tiddlers.
MySQL was a convenient choice at the time. I've since been
investigating using redis but there hasn't been time to get it feature
complete.
> Or has TiddlyWeb's storage in the filesystem been replaced in
> TiddlySpace
> by storage in a relational database?
Yes see above about storage interface implementations.
> My goal here is to make a site which could help students learn
> English.
This is something I've seen done on TiddlySpace with Russian speakers
learning English, but mostly as a reference. But it ought to work well
in the pattern you describe.
> I could let each student have their own webpage, eg:
Yes.
> This could be helpful to let each student take notes on their own
> wiki.
> And I guess over time their wiki could become more and more
> personalized,
> reflecting which "learning modules" they had selected and studied
> (they don't have to do them all!)
> and reflecting their answers on quizzes and tests
> (which could be text, multiple-choice, audio or video answers).
One option you might pursue is putting lesson content in spaces. Then
when a student chooses to work on lesson they would include that
lesson's space in their own, do their exercises, making notes in their
own space.
> Question: What is the best way for including media (audio, video) in a
> Tiddler?
http://tiddlyweb.peermore.com/wiki/#%5B%5Bbinary%20tiddler%5D%5D
That links to an explanation of how to do a raw PUT to get binary
content into the server. Another option is, inside a TiddlyWiki
generated by TiddylSpace to have a tiddler containing the binaryUpload
macro:
<<binaryUpload edit:title>>
However TiddlyWeb is not ideal for delivering huge binary content. If
you're going to have that, it is often best to host it as a file
somewhere else and maintain (in a tiddler of course) a reference to
the somewhere else by link.
> Some media might be hosted at YouTube and linked from there -
> but some media would be hosted and streamed from my server.
There are tiddlywiki plugins for embedding external videos.
> For quizzes, I assume there is some way of including a Form in a
> Tiddler,
> and so the user (a student) could answer questions,
> and then click OK to send this to the server.
There are a variety of tiddlywiki plugins that allow quizzing and
recording the results.
> Question: Are there existing modules for TiddlyWeb
> which make it easy to create and use Forms?
In TiddlyWeb, not a great deal. It's really oriented towards just
handling the GETting and PUTting of tiddlers. In _TiddlyWiki_ there's
lots of stuff for translating form input into a structured tiddler
which can then be saved to the server. Ask around the tiddlywiki group
about such things. Sometimes they need to be adapted to work
effectively with a server, but if they do the changes are usually
minor.
> So I am eager to learn more about the approaches used in TiddlyWeb
> for:
TiddlyWeb isn't a framework in the sense that say Rails or Django is,
but it can fake it if desired. It is more of a toolkit for tiddlers on
the web which can use (server-side) plugins to do all this stuff:
> (1) routing
> (2) page templating and layout
> (3) customized content (eg, streaming audio and video)
> (4) submitting forms
See:
http://pypi.python.org/pypi?%3Aaction=search&term=tiddlywebplugins
for published plugins.
> I am also curious about authentication and authorization,
> and would appreciate any pointers in that direction.
This is a good starting point for the concepts related to Auth{N,Z}:
http://tiddlyweb.peermore.com/wiki/#%5B%5BAuth%20Model%5D%5D
> I suppose maybe it is possible to simply
> absorb a lot of this hands-on and intuitively,
> while manipulating the webpage itself.
Yes, also you can browse around the server and poke at things to see
what URLs exist and what the present. For lots of the if you stick
'.txt' or '.json' on the end you'll get a different representation.
Another thing you can do is explore the information presented by a
recently created plugin installed on tiddlyspace.com, it creates
automatic docs. See this thread where I announced it:
http://groups.google.com/group/tiddlyweb/browse_frm/thread/959ec1eab0156583
Keep in mind that there is a fairly big difference/boundary between
TiddlyWeb, the server which is storing and providing the tiddlers, and
TiddlyWiki (just) one of the applications which can be used to view
those tiddlers. What a tiddler like "SiteTitle" means is different
depending on the context. In TiddlyWeb it is just another tiddler, in
TiddlyWiki it is the title on the page that you see when looking at
the TiddlyWiki.
Most of the things you describe here:
> I already did manage to figure out that
> I shouldn't've changed the "title" part of SiteTitle
> - just the "body text" part -
> which led to the discovery that the "title" part of a Tiddler is the
> variable name,
> and the "body text" part is the value -
> which led to a lot of further understandings and intuitions about how
> TiddlyWeb works.
are about TiddlyWiki, not TiddlyWeb.
I think the distinction is fairly important. Yes they are operating in
the same place and when you see one you often see the other, but you
don't always, and when you think you do (or think you don't) and you
don't (or do), things get weird.
> Well sorry for rambling on, I just really do like TiddlyWeb.
I'm glad.
> And it is nice to have open-ended questions about potential ways of
> using a system -
> rather than frustrated questions about how to install it :-)
Yes.
Good luck with it all. Looking forward to hearing about what you
accomplish and discover.
--
Chris Dent http://burningchrome.com/
[...]
--
You received this message because you are subscribed to the Google Groups "TiddlyWeb" group.
To post to this group, send email to tidd...@googlegroups.com.
To unsubscribe from this group, send email to tiddlyweb+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tiddlyweb?hl=en.
Indeed - I've often wanted to do this, but somehow never got around to
it. (Perhaps that's because in TiddlyWiki, this would have required some
special-casing in the adaptor. But if I were to write a new client, I'd
probably implement it that way, perhaps using a content-type which might
then make the client display such tiddlers using a UI like TiddlyWeb
Commander[1]'s.)
>> Well sorry for rambling on, I just really do like TiddlyWeb.
>
> I'm glad.
Ditto - this was a very interesting read.
> Is it possible to get the actual tiddlers from /search.json in JSON
> format rather than just tiddler metadata?
You can add the `fat` parameter:
$ curl -X GET -H "Accept: application/json" \
"http://tiddlyspace.com/search?q=modifier:fnd;fat=1" | \
python -m json
-- F.
> Ah, thanks, very cool!
> The "fat" was what I needed.
You can also say 'render=1' to get the HTML rendering of the tiddler
in a render field as well.
Both fat and render add some expense to the request.
The expectation with "skinny" JSON collections was that you'd get
the skinny stuff, and then only get the text of those that you
_really_ cared about, individually.