How to write a tiddlerdeserializer

98 views
Skip to first unread message

Danielo Rodríguez

unread,
Jun 11, 2015, 2:58:15 PM6/11/15
to tiddly...@googlegroups.com
Hello

I am trying to write a tiddler deserializer for this task: extract tiddlers from a custom file extension.

I know that I have to create a module-type: tiddlerdeserializer, I did, but i have no clue to where register the fileExtensionInfo. Currently I'm doing it on the deserializer itself, but it is not working. How should I configure this? What is the correct way? Seems easy, but I'm obviously missing something.

Thanks in advance.

Danielo Rodríguez

unread,
Jun 11, 2015, 3:06:47 PM6/11/15
to tiddly...@googlegroups.com
Just to be clear,

The  problem is that the files with that custom extension are not being loaded when the node.js server starts. And the place where I register the extension is just before the exports of the deserializer module.

Regards

Jeremy Ruston

unread,
Jun 13, 2015, 10:33:51 AM6/13/15
to TiddlyWikiDev
Hi Danielo

Under Node.js, tiddlers are loaded from the wiki folder during the boot process. There's a Catch-22 with the ordering of loading the tiddler files and processing plugins: we can't process the plugins before we load the files containing them, therefore the plugins are not available when we load the files.

What is your use case?

Best wishes

Jeremy.


--
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 tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/9c8854de-7b1d-4ddd-acc8-d175ec68f936%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Danielo Rodríguez

unread,
Jun 13, 2015, 5:14:58 PM6/13/15
to tiddly...@googlegroups.com
Hello Jeremy,

It's not a plugin, it's just a plain deserializer module. I want to register my deserializer for certain type of files, and make the core load that tiddlers through my deserializer. It works when the wiki is loaded already and I drag a file of that type, but it does not work with files contained in the Tiddlers folder.

Jeremy Ruston

unread,
Jun 13, 2015, 5:45:27 PM6/13/15
to TiddlyWikiDev
Hi Danielo

It's not a plugin, it's just a plain deserializer module. I want to register my deserializer for certain type of files, and make the core load that tiddlers through my deserializer. It works when the wiki is loaded already and I drag a file of that type, but it does not work with files contained in the Tiddlers folder.

It's the same for a module: modules don't get registered until after all tiddlers have been loaded from the file system. Therefore modules in those tiddlers are not available during the loading process. See the sequence here:


Best wishes

Jeremy.

 

--
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 tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.

For more options, visit https://groups.google.com/d/optout.

Danielo Rodríguez

unread,
Jun 14, 2015, 9:06:05 AM6/14/15
to tiddly...@googlegroups.com
So the only way to accomplish this is modifying the core, right? It's not even possible with an startup module. Unless you specifically search for the files of course.

Jeremy Ruston

unread,
Jun 14, 2015, 6:14:09 PM6/14/15
to TiddlyWikiDev
On Sun, Jun 14, 2015 at 2:06 PM, Danielo Rodríguez <rdan...@gmail.com> wrote:
So the only way to accomplish this is modifying the core, right? It's not even possible with an startup module. Unless you specifically search for the files of course.

That's correct. This is an area where the boot kernel is primitive merely because the need to be smarter hasn't arisen before.

Can you expand on the use case a bit more?

One possibility may be to have your files in a different folder within the wiki folder (eg "danielo_tiddlers" instead of "tiddlers"). That way the filesystem adaptor will ignore them, and your plugin can process them when it starts up.

Best wishes

Jeremy


 

--
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 tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.

For more options, visit https://groups.google.com/d/optout.

Danielo Rodríguez

unread,
Jun 15, 2015, 2:57:38 AM6/15/15
to tiddly...@googlegroups.com, jeremy...@gmail.com
Hello Jeremy


 
That's correct. This is an area where the boot kernel is primitive merely because the need to be smarter hasn't arisen before.

Can you expand on the use case a bit more?

I am  using tiddlymap to create an searchable comfortable way of viewing my company DB. For doing so I export tables definitions as plain text files. In order to turn tables and its properties into tiddlers with relations, I wrote a tiddler deserializer to parse the export files. I would prefer to just put those files on a certain folder and import them on startup instead of having to drag and drop them once TW has started. 


 
One possibility may be to have your files in a different folder within the wiki folder (eg "danielo_tiddlers" instead of "tiddlers"). That way the filesystem adaptor will ignore them, and your plugin can process them when it starts up.

I am not creating a plugin, it's just a plain tiddler deserializer. I think this task does not deserve an entire plugin. But maybe I should create also a startup module. But, I think this kind of things is something TW should implement sooner or later.

Jeremy Ruston

unread,
Jun 15, 2015, 11:10:52 AM6/15/15
to Danielo Rodríguez, TiddlyWikiDev
Hi Danielo

Without a concrete proposal for how we'd address the chicken-and-egg problem of loading serialisers from tiddlers that are loaded from serialisers (!), I'd recommend taking the approach of a separate folder within the wiki folder, and a startup module.

Best wishes

Jeremy.

Reply all
Reply to author
Forward
0 new messages