Qs regarding hidden structure of a TSpace

10 views
Skip to first unread message

Plausible

unread,
Oct 27, 2010, 9:44:53 AM10/27/10
to TiddlyWeb
Hello,

So I learn that in TiddlySpace a tiddler called myTiddler can be
accessed using mySpaceName.tiddlyspace.com/myTiddler.txt

Are tiddlers actually stored like that, and does the html space file
get 'built' from these files, or is it the other way around? Is there
a doc explaining such matters?

I've got two somewhat related questions:

(1) I'd like to use the ASCIIMathMLPlugin by Paulo Soares; it seems
this requires ASCIIMathML.js to be present wherever the HTML file is,
so in online use that'd be on the TS server? Could I get that there -
perhaps with BinaryUpload? Or is this against TS rules?

(2) http://code.google.com/webfonts/preview gives you some HTML and
some CSS to include a font in your webpage. I reckon for TS the CSS
could go in StyleSheet; but where to put the HTML <link ...> thingy?

cheers,

~P

colmjude

unread,
Oct 27, 2010, 10:54:48 AM10/27/10
to TiddlyWeb


On Oct 27, 2:44 pm, Plausible <Verreh...@yahoo.com> wrote:
> Hello,
>
> So I learn that in TiddlySpace a tiddler called myTiddler can be
> accessed using mySpaceName.tiddlyspace.com/myTiddler.txt
>
> Are tiddlers actually stored like that,

As far as I am aware, Tiddlers are stored in a MySQL store (maybe one
of the other guys can give you more info on this, and [1] might help
too). However there are numerous serialisations of a tiddler
available. You can get
.txt
.html
.json
.atom
serialisations of your tiddlers.

>
> (1) I'd like to use the ASCIIMathMLPlugin by Paulo Soares; it seems
> this requires ASCIIMathML.js to be present wherever the HTML file is,
> so in online use that'd be on the TS server? Could I get that there -
> perhaps with BinaryUpload? Or is this against TS rules?

You can package up separate javascript plugins/libraries and use them
as plugins in the tiddlyspace world.
Have a look at [2] and [3] for some ideas on how to do this (hope
that's what you meant).

>
> (2)http://code.google.com/webfonts/previewgives you some HTML and
> some CSS to include a font in your webpage. I reckon for TS the CSS
> could go in StyleSheet; but where to put the HTML <link ...> thingy?
>
Yes you can do this.
The <link ...> needs to go in the markupPreHead shadow tiddler. E.g.
<link href="http://fonts.googleapis.com/css?family=Reenie
+Beanie:regular" rel="stylesheet" type="text/css"> gets the Reenie
Beanie font from google fonts. You can then use it in your CSS
However on tiddlyspace there is now a font space
(fonts.tiddlyspace.com) that will have publicly available fonts for
you to use in your space. Have a gander, I think there are
instructions in there. If not just let us know and we can provide
some.

Hope that helps

Colm

[1] - http://tiddlyweb.com/
[2] - http://jqueryui.tiddlyspace.com/
[3] - http://charts.tiddlyspace.com has the raphael.js library
packaged up

Ben Gillies

unread,
Oct 27, 2010, 11:18:41 AM10/27/10
to tidd...@googlegroups.com
On Wed, Oct 27, 2010 at 3:54 PM, colmjude <colm...@gmail.com> wrote:


On Oct 27, 2:44 pm, Plausible <Verreh...@yahoo.com> wrote:
> Hello,
>
> So I learn that in TiddlySpace a tiddler called myTiddler can be
> accessed using mySpaceName.tiddlyspace.com/myTiddler.txt
>
> Are tiddlers actually stored like that,

As far as I am aware, Tiddlers are stored in a MySQL store (maybe one
of the other guys can give you more info on this, and [1] might help
too). However there are numerous serialisations of a tiddler
available. You can get
.txt
.html
.json
.atom
serialisations of your tiddlers.

That's correct. In TiddlySpace, tiddlers are stored on the server in a MySQL database, using the tiddlywebplugins.mysql  plugin (http://pypi.python.org/pypi?:action=search&term=tiddlywebplugins.mysql&submit=search) (actually a slightly modified version). The text serialization is generated after the different components of the tiddler are retrieved from this database (the fields are stored in a separate table for example).

In classic TiddlyWeb however, using the text store, tiddlers are indeed stored in the same format as the text serialization, with one tiddler per file.

The best places to learn about the internals of TiddlyWeb/TiddlySpace are:



Hope this helps somewhat.


Ben 

chris...@gmail.com

unread,
Oct 28, 2010, 7:52:30 AM10/28/10
to TiddlyWeb
On Wed, 27 Oct 2010, Plausible wrote:

> Are tiddlers actually stored like that, and does the html space file
> get 'built' from these files, or is it the other way around? Is there
> a doc explaining such matters?

Just to add a bit to what Colm and Ben have said:

Internal to itself TiddlyWeb passes around Tiddler's as objects. At
boundaries between places (such as between the main code and the
storage system or the main code and the web server) the objects are
turned into different forms. On the web side these forms are called
representations. By default in TiddlyWeb the representations are
text, JSON and very plain HTML. TiddlyWebWiki adds TiddlyWiki and
richer HTML (tiddler wikitext rendered as HTML).

Other server-side plugins add other representations, such as Atom.

At the storage interface the tiddler objects are turned into
whatever is useful for that that storage system. In the case of
TiddlySpace they become rows in a set of database tables. In core
TiddlyWeb they become files of text stored on disk in a hierarchy of
directories. As you've read, the text files look just like what
you'll see at /bags/foo/tiddlers/bar.txt.

There are lots of storage and representation (and other) tiddlyweb
plugins here:

http://pypi.python.org/pypi?%3Aaction=search&term=tiddlywebplugins

A fair few of those are used with TiddlySpace:

atom
caching
console
form
instancer
lazy
magicuser
mysql
oom
openid2
pathinfohack
prettyerror
reflector
sqlalchemy
status
utils
cookiedomain
differ
hashmaker
logout
mselect
socialusers
virtualhosting
wikklytextrender

(I've probably left out a few)

> (2) http://code.google.com/webfonts/preview gives you some HTML and
> some CSS to include a font in your webpage. I reckon for TS the CSS
> could go in StyleSheet; but where to put the HTML <link ...> thingy?

I do this in my own space. You don't need to put a <link > thingy
anywhere. What I did was:

* upload the font file as a binary tiddler
* add some stylesheet info

http://cdent.tiddlyspace.com/bags/cdent_public/tiddlers/StyleSheetFonts.html

* make sure that StyleSheetFonts is included in StyleSheet

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

Plausible

unread,
Nov 3, 2010, 6:01:55 AM11/3/10
to TiddlyWeb
Belated thanks for that information, folks. It seems to explain why an
exported space (so just the HTML file) does not allow saving of new or
modified tiddlers locally. This is unfortunately a critical problem
for me... would there be a way around it? I suppose it would involve
having at least some of the server-side infrastructure present
locally?

On Oct 27, 2:54 pm, colmjude <colmj...@gmail.com> wrote:
> You can package up separate javascript plugins/libraries and use
> them as plugins in the tiddlyspace world.
> Have a look at [2] and [3] for some ideas on how to do this (hope
> that's what you meant).

I tried but no joy. The JavaScript code is e.g. here: [1]. The
instructions on [2] say to add a <script>...</script> line to the
page, which I assume on TSpace goes in MarkupPreHead. The intention is
to have the equations in a tiddler like [3] display properly.

* Attempt 1 (à la Colm's suggestion):

Creating a tiddler called ASCIIMathML.js and pasting the
ASCIIMathML.js code into it, then adding

<script type="text/javascript" src="ASCIIMathML.js"></script>

to MarkupPreHead leads to all formatting of the space being lost: I
get a white page with the elements of the page (links, icons) listed
top to bottom. Things are more or less functioning (tiddler creation
etc) but it looks bad. Moreover, the ASCII equations do not display
properly.

* Attempt 2:

Dropping a copy of ASCIIMathML.js in my public Dropbox folder and
putting

<script type="text/javascript" src="http://MyDropboxURLHere/
ASCIIMathML.js"></script>

in MarkupPreHead gives bad results. The space takes a lot of time and
CPU power in trying to load, then I get an error pop-up:

SyntaxError unterminated string literal undefined undefined
axes(); ",
lookaheadRegExp: /agraph((?:.|\n)*?)

and then a blank page in FF, or in Chrome a loaded space but without
backstage or editing access and with plenty of macro errors everywhere
(Error in macro <<tiddlerOrigin>>Error in macro <<setPrivacy>> etc). I
have to rename/delete the .js file on Dropbox in order to make the
space behave again.

What am I doing wrong now? :)

cheers, ~P

[1] http://www.math.ist.utl.pt/~psoares/ASCIIMathML.js
[2] http://www1.chapman.edu/~jipsen/mathml/asciimath.html
[3] http://www.math.ist.utl.pt/~psoares/asciimathml.html#ASCIIMath

FND

unread,
Nov 3, 2010, 8:12:23 AM11/3/10
to tidd...@googlegroups.com
> It seems to explain why an exported space (so just the HTML file)
> does not allow saving of new or modified tiddlers locally.

It does - it's just not very well exposed; you need to manually trigger
saveChanges, e.g. via the macro of the same name:
http://tiddlywiki.org/wiki/SaveChanges

We're working on making the offline experience more seamless.


-- F.

Reply all
Reply to author
Forward
0 new messages