Skip to content

Commit

Permalink
Fix support for Node.js & update jsdom dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvine committed Mar 7, 2018
1 parent 1d399cb commit 262abf5
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 22 deletions.
4 changes: 1 addition & 3 deletions README.md
Expand Up @@ -22,9 +22,7 @@ var rendered = notebook.render();
document.body.appendChild(rendered);
```

### IO.js Usage

*Note: To take advantage of `jsdom`'s latest features/bugfixes, `notebook.js` now runs on [io.js](https://iojs.org/) instead of Node.js.*
### Node.js Usage

To install:

Expand Down
2 changes: 1 addition & 1 deletion bin/cli-render.js
@@ -1,4 +1,4 @@
#!/usr/bin/env iojs
#!/usr/bin/env node
// Reads a notebook from stdin, prints the rendered HTML to stdout
var fs = require("fs");
var nb = require("../notebook.js");
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Expand Up @@ -20,7 +20,7 @@
"tests"
],
"dependencies" : {
"jsdom": ">=4.0.0",
"jsdom": ">=11.6.2",
"marked": ">=0.3.3",
"ansi_up": ">=1.1.3"
}
Expand Down
10 changes: 7 additions & 3 deletions notebook.js
@@ -1,12 +1,16 @@
// notebook.js 0.2.7
// notebook.js 0.2.8
// http://github.com/jsvine/notebookjs
// notebook.js may be freely distributed under the MIT license.
(function () {
var root = this;
var VERSION = "0.2.7";
var VERSION = "0.2.8";

// Get browser or JSDOM document
var doc = root.document || require("jsdom").jsdom();
var doc = root.document;
if (!doc) {
var jsdom = require("jsdom");
doc = new jsdom.JSDOM().window.document;
}

// Helper functions
var ident = function (x) { return x; };
Expand Down
2 changes: 1 addition & 1 deletion notebook.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 19 additions & 13 deletions package.json
@@ -1,17 +1,23 @@
{
"name" : "notebookjs",
"version" : "0.2.7",
"description" : "Parse and render IPython/Jupyter notebooks.",
"main" : "notebook.js",
"homepage" : "https://github.com/jsvine/notebookjs",
"keywords" : [ "ipython", "jupyter" ],
"author" : "Jeremy Singer-Vine <jsvine@gmail.com>",
"contributors" : [],
"name": "notebookjs",
"version": "0.2.7",
"description": "Parse and render IPython/Jupyter notebooks.",
"main": "notebook.js",
"homepage": "https://github.com/jsvine/notebookjs",
"keywords": [
"ipython",
"jupyter"
],
"author": "Jeremy Singer-Vine <jsvine@gmail.com>",
"contributors": [],
"license": "MIT",
"dependencies" : {
"jsdom": ">=4.0.0",
"marked": ">=0.3.3",
"ansi_up": ">=1.1.3"
"dependencies": {
"ansi_up": ">=1.1.3",
"jsdom": ">=11.6.2",
"marked": ">=0.3.3"
},
"repository" : {"type": "git", "url": "git://github.com/jsvine/notebookjs.git"}
"repository": {
"type": "git",
"url": "git://github.com/jsvine/notebookjs.git"
}
}

0 comments on commit 262abf5

Please sign in to comment.