Last active
August 29, 2015 14:13
-
-
Save Arlen22/d7ad0b6a108fa3cedf72 to your computer and use it in GitHub Desktop.
How to use node-webkit with tiddlywiki GitHub code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head></head> | |
<body class="tc-body"> | |
<script>process.mainModule.exports.boot();</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.boot = function() { | |
console.log('booted'); | |
console.log(window); | |
global.$tw = require("./boot/bootprefix.js").bootprefix(); | |
$tw.boot.suppressBoot = true ; | |
$tw.boot.argv = ['./editions/server']; | |
$tw = require("./boot/boot.js").TiddlyWiki($tw); | |
$tw.boot.boot(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"node-main": "./nodewebkit.js", | |
"main":"./index.htm", | |
... |
Does this require the node.js version of tiddlywiki?
There is no packaje.json in plain node-webkit. Where should I pick it up?
Dear @Arlen22
Ok, there is a package.json on main tw5 folder (the one you download from github). I edited it aso you say, and copied all the elements from TW5 folder to the node-webkit folder. But it does not work.
Here is my package.json file
{
"node-main": "./nodewebkit.js",
"main":"./index.htm",
"name": "tiddlywiki",
"preferGlobal": "true",
"version": "5.1.5",
"author": "Jeremy Ruston <[email protected]>",
"description": "a non-linear personal web notebook",
"contributors": [
{
"name": "Jeremy Ruston",
"email": "[email protected]"
}
],
"bin": {
"tiddlywiki": "./tiddlywiki.js"
},
"repository": {
"type": "git",
"url": "https://github.com/Jermolene/TiddlyWiki5.git"
},
"keywords": [
"tiddlywiki",
"tiddlywiki5",
"wiki"
],
"dependencies": {},
"devDependencies": {},
"bundleDependencies": [],
"license": "BSD",
"engines": {
"node": ">=0.8.2"
}
}
Copy index.htm and nodewebkit.js into the main tw5 folder and then specify the tiddlywiki folder path as the first argument to nodewebkit (path/to/nw.exe /path/to/tw5/
).
Here is a simpler way: https://gist.github.com/Arlen22/45f1a460c9e348fa50ad
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Edit the package.json file, to include the two items above, but leave the rest there. Make sure you don't have two "main"s. Main is already set farther down, so you'll need to remove it.