1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 13:29:56 +00:00

Removed the old command line interfaces

This commit is contained in:
Jeremy Ruston 2011-12-08 16:42:09 +00:00
parent c3331cb090
commit 7d6b1b8735
3 changed files with 0 additions and 75 deletions

18
cook.js
View File

@ -1,18 +0,0 @@
// Cook a TiddlyWiki recipe and send it to STDOUT
//
// Usage: node cook.js <recipefile>
/*global require: false, exports: false */
"use strict";
var WikiStore = require("./js/WikiStore.js").WikiStore,
Recipe = require("./js/Recipe.js").Recipe,
util = require("util");
var filename = process.argv[2];
var store = new WikiStore();
var theRecipe = new Recipe(store,filename,function() {
process.stdout.write(theRecipe.cook());
});

View File

@ -1,32 +0,0 @@
// Break apart a TiddlyWiki HTML file into separate .tid files
//
// Usage: node ginsu.js <tiddlywikifile> <outputdir>
//
// The .html extension is optional
//
// Ginsu creates the specified places the .tid files in the specified directory (which must already exist)
"use strict";
var fs = require("fs"),
path = require("path"),
Tiddler = require("./js/Tiddler.js").Tiddler,
tiddlerInput = require("./js/TiddlerInput.js"),
tiddlerOutput = require("./js/TiddlerOutput.js");
var tiddlywikifilename = process.argv[2];
var outputdir = process.argv[3];
var tiddlywikidoc = fs.readFileSync(tiddlywikifilename,"utf8");
var tiddlers = tiddlerInput.parseTiddlerFile(tiddlywikidoc,"application/x-tiddlywiki");
var recipe = [];
for(var t=0; t<tiddlers.length; t++) {
var tid = new Tiddler(tiddlers[t]);
var filename = encodeURIComponent(tid.fields.title.replace(/ /g,"_")) + ".tid";
fs.writeFileSync(path.join(outputdir,filename),tiddlerOutput.outputTiddler(tid));
recipe.push("tiddler: " + filename + "\n");
}
fs.writeFileSync(path.join(outputdir,"split.recipe"),recipe.join(""));

View File

@ -1,25 +0,0 @@
// Cook a TiddlyWiki recipe and serve the result over HTTP
//
// Usage: node server.js <recipefile>
"use strict";
var WikiStore = require("./js/WikiStore.js").WikiStore,
Recipe = require("./js/Recipe.js").Recipe,
http = require("http"),
fs = require("fs"),
url = require("url"),
path = require("path"),
util = require("util");
var filename = process.argv[2];
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/html"});
var store = new WikiStore(),
theRecipe = new Recipe(store,filename,function() {
response.end(theRecipe.cook(), "utf-8");
});
}).listen(8000);
util.puts("Server running at http://127.0.0.1:8000/");