mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-02 12:19:11 +00:00
Added plain module serialiser
Needed when we pack lots of modules into a single .js file
This commit is contained in:
parent
bf75735db9
commit
1896063788
@ -22,7 +22,7 @@ var mapEachTiddler = function(wiki,tiddlers,callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result.join("");
|
return result.join("");
|
||||||
}
|
};
|
||||||
|
|
||||||
exports["text/plain"] = function(tiddlers) {
|
exports["text/plain"] = function(tiddlers) {
|
||||||
return mapEachTiddler(this,tiddlers,function(tiddler) {
|
return mapEachTiddler(this,tiddlers,function(tiddler) {
|
||||||
@ -89,6 +89,12 @@ exports["application/x-tiddler-module"] = function(tiddlers) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports["application/x-tiddler-module-plain"] = function(tiddlers) {
|
||||||
|
return mapEachTiddler(this,tiddlers,function(tiddler) {
|
||||||
|
return "$tw.modules.define(\"" + tiddler.fields.title + "\",\"" + tiddler.fields["module-type"] + "\",function(module,exports,require) {" + tiddler.fields.text + "});\n";
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
exports["application/x-tiddler-library"] = function(tiddlers) {
|
exports["application/x-tiddler-library"] = function(tiddlers) {
|
||||||
return mapEachTiddler(this,tiddlers,function(tiddler) {
|
return mapEachTiddler(this,tiddlers,function(tiddler) {
|
||||||
var attributes = {
|
var attributes = {
|
||||||
|
Loading…
Reference in New Issue
Block a user