diff --git a/rabbithole/core/modules/startup.js b/rabbithole/core/modules/startup.js index 0aa547a21..e1f8991cd 100644 --- a/rabbithole/core/modules/startup.js +++ b/rabbithole/core/modules/startup.js @@ -16,17 +16,19 @@ exports.startup = function() { var modules,n,m,f,commander; // Set up additional global objects $tw.plugins.applyMethods("global",$tw); - // Reinstall the plugin categories that were installed during the kernel boot process - $tw.Tiddler.fieldPlugins = $tw.plugins.getPluginsByTypeAsHashmap("tiddlerfield"); - $tw.plugins.applyMethods("tiddlerdeserializer",$tw.Wiki.tiddlerDeserializerPlugins); - // Wire up other plugin modules + // Wire up plugin modules $tw.plugins.applyMethods("config",$tw.config); $tw.plugins.applyMethods("utils",$tw.utils); - $tw.version = $tw.utils.extractVersionInfo(); + $tw.Tiddler.fieldPlugins = $tw.plugins.getPluginsByTypeAsHashmap("tiddlerfield"); $tw.plugins.applyMethods("tiddlermethod",$tw.Tiddler.prototype); $tw.plugins.applyMethods("wikimethod",$tw.Wiki.prototype); + $tw.plugins.applyMethods("tiddlerdeserializer",$tw.Wiki.tiddlerDeserializerPlugins); + $tw.Wiki.tiddlerSerializerPlugins = {}; + $tw.plugins.applyMethods("tiddlerserializer",$tw.Wiki.tiddlerSerializerPlugins); $tw.plugins.applyMethods("treeutils",$tw.Tree); $tw.plugins.applyMethods("treenode",$tw.Tree); + // Get version information + $tw.version = $tw.utils.extractVersionInfo(); // Load up the tiddlers in the root of the core directory (we couldn't do before because we didn't have the serializers installed) if(!$tw.isBrowser) { $tw.plugins.loadPluginsFromFolder($tw.boot.bootPath,"$:/core",/^\.DS_Store$|.meta$|^modules$/); diff --git a/rabbithole/core/modules/wiki.js b/rabbithole/core/modules/wiki.js index 49c099dbd..446838792 100644 --- a/rabbithole/core/modules/wiki.js +++ b/rabbithole/core/modules/wiki.js @@ -118,6 +118,16 @@ exports.addTiddler = function(tiddler) { this.touchTiddler(title); }; +exports.serializeTiddler = function(title,type) { + var serializer = $tw.Wiki.tiddlerSerializerPlugins[type], + tiddler = this.getTiddler(title); + if(serializer) { + return serializer.call(this,tiddler); + } else { + return null; + } +}; + /* Return a sorted array of tiddler titles, optionally filtered by a tag */