Skip to content

Instantly share code, notes, and snippets.

@Arlen22
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Arlen22/d7ad0b6a108fa3cedf72 to your computer and use it in GitHub Desktop.
Save Arlen22/d7ad0b6a108fa3cedf72 to your computer and use it in GitHub Desktop.
How to use node-webkit with tiddlywiki GitHub code.
<!doctype html>
<html>
<head></head>
<body class="tc-body">
<script>process.mainModule.exports.boot();</script>
</body>
</html>
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();
};
{
"node-main": "./nodewebkit.js",
"main":"./index.htm",
...
@Arlen22
Copy link
Author

Arlen22 commented Jan 21, 2015

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.

@danielo515
Copy link

Does this require the node.js version of tiddlywiki?
There is no packaje.json in plain node-webkit. Where should I pick it up?

@danielo515
Copy link

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 <jeremy@jermolene.com>",
  "description": "a non-linear personal web notebook",
  "contributors": [
    {
      "name": "Jeremy Ruston",
      "email": "jeremy@jermolene.com"
    }
  ],
  "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"
  }
}

@Arlen22
Copy link
Author

Arlen22 commented Jan 22, 2015

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/).

@Arlen22
Copy link
Author

Arlen22 commented Jan 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment