Different sets of formatters in a TW

2 views
Skip to first unread message

PauloSoares

unread,
Nov 3, 2006, 9:40:21 AM11/3/06
to TiddlyWikiDev
I've looked at the collection of formatters that Martin Budden is
putting up and I understood that they make possible to render a TW
written in one of several different markup dialects.

My question is: can I mix them in a single TW file? That is, is it
possible to render a tiddler in a way that the set of formatters is
chosen according to a tag, a field value or something else?

I see that including formatters for a few other markup dialects may
inflate substantially the TW file size but, anyway, do you think this
could be useful?

Jeremy Ruston

unread,
Nov 3, 2006, 12:00:44 PM11/3/06
to Tiddly...@googlegroups.com
You can indeed have multiple formatter sets installed at once, you
switch between them on an individual tiddler basis using tags.

So, Martin's MediaWiki plugin is triggered by the tag
"MediaWikiFormat", for instance.

For me, the interesting scenario for using these plugins is to enable
content to be mingled from different sources, and to permit that
content to be created and editted whilst being offline, with a
subsequent sync process to deliver it back to the server.

Cheers

Jeremy


--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com

PauloSoares

unread,
Nov 3, 2006, 12:33:30 PM11/3/06
to TiddlyWikiDev
> You can indeed have multiple formatter sets installed at once, you
> switch between them on an individual tiddler basis using tags.

Thanks Jeremy, I was no aware of that. I've just tried the
MediaWikiFormatter and, at first, it didn't work in my TW 2.1.2. Then,
I found out that it simply does not work together with the jsMath
plugin.

Bob McElrath

unread,
Nov 3, 2006, 6:52:41 PM11/3/06
to Tiddly...@googlegroups.com

Well that's unfortunate.

It appears that the wikify() function has changed to enable the
MediaWikiFormatter (etc). So, just modify the end of Plugin: jsMath as
follows:

window.wikify = function(source,output,highlightRegExp,tiddler)
{
if(source && source != "")
{
var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
wikifier.subWikifyUnterm(output);
jsMath.ProcessBeforeShowing();
}
}

--
Cheers,
Bob McElrath [Univ. of California at Davis, Department of Physics]

A people that values its privileges above its principles soon loses both.
- Dwight Eisenhower

signature.asc

PauloSoares

unread,
Nov 3, 2006, 7:17:49 PM11/3/06
to TiddlyWikiDev
Nice Bob, almost perfect. The rendering of tables is not entirely
correct but it's much better now.
--
Paulo Soares

Martin Budden

unread,
Nov 4, 2006, 9:23:11 AM11/4/06
to TiddlyWikiDev
Paulo,

the formatters were designed to allow you to have different tiddlers
with different formats - one of the things I wanted to enable was the
use of Tiddlywiki as a content aggregator, allowing you to mix content
from a variety of sources in a single Tiddlywiki without requiring it
to be reformatted.

Currently you have to manually copy the text into Tiddlywiki, but, as
Jeremy says, this becomes even more interesting when content can be
fetched and re-synch'ed to sources programatically.

Martin

PauloSoares

unread,
Nov 4, 2006, 9:54:50 AM11/4/06
to TiddlyWikiDev
Thanks Martin for your explanation. I want to try making a similar
plugin for basic LaTeX structures so I can paste simple LaTeX texts in
tiddlers. Sadly, I'm not yet able to fully understand formatters and
particularly their regular expressions.
--
Paulo Soares

Reply all
Reply to author
Forward
0 new messages