Parse and render Jupyter/IPython notebooks.
npm install notebookjsv0.8.3Notebook.js parses raw Jupyter/IPython notebooks, and lets you render them as HTML. See a __working demo here__.
Notebook.js works in the browser and in Node.js. Usage is fairly straightforward.
First, provide access to nb via a script tag:
``html`
Then parse, render, and (perhaps) append:
``
var notebook = nb.parse(JSON.parse(raw_ipynb_json_string));
var rendered = notebook.render();
document.body.appendChild(rendered);
To install:
`sh`
npm install notebookjs
Then parse, render, and write:
`js`
var fs = require("fs");
var nb = require("notebookjs");
var ipynb = JSON.parse(fs.readFileSync("path/to/notebook.ipynb"));
var notebook = nb.parse(ipynb);
console.log(notebook.render().outerHTML);
On Node.js, notebook.js uses marked for Markdown rendering, and ansi_up for ANSI-coloring.
The browser-based version does not, however, ship with those libraries, so you must