Hello everyone.

Reading the boot.js code I found several helper functions to register new 
file types. I'm talking about registerFileType function. But what if I just 
want to register a new extension? registerFileType overrides the 
contentType info with the information you provide to it, so it's not useful 
to just register a new file extension. Is enough to just do : 
$tw.config.fileExtensionInfo[extension] = {type: type}


Is that ok?

What if I want to create a new deserializer? I saw this done like this:
$tw.modules.define("$:/boot/tiddlerdeserializer/js","tiddlerdeserializer",{
"application/javascript": function(text,fields) {


Is that the correct way?
When is that related with tiddlerDeserializerModules ? I'm quite confused 
here. The code of deserializeTiddlers looks up all the time on the 
tiddlerDeserializerModules object. When are specific deserializers for 
specific types used? I mean those that are registered by registerFileType. 
I think this is done here but I'm not sure

if(!deserializer && $tw.config.contentTypeInfo[type]) {
// see if this type has a different deserializer registered with it
type = $tw.config.contentTypeInfo[type].deserializerType;
deserializer = $tw.Wiki.tiddlerDeserializerModules[type];
}

So what is registered on contenTypeInfo is just THE NAME of the 
deserializer to use.

One last question: when are deserializers called? Let's say that I just 
want to add specific prefix and suffix to the text field of certain file 
types.. is a deserializer the correct way of doing this?

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to