New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

notebook-preview

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notebook-preview - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

lib/components/cell/cell.js

70

package.json
{
"name": "notebook-preview",
"version": "0.0.0",
"description": "Prototype notebook previewer as a React component",
"version": "0.0.1",
"description": "Lightweight preview of a notebook, nteract style",
"main": "lib/index.js",
"scripts": {
"start": "node server.js",
"lint": "eslint src"
"build": "babel src --out-dir lib",
"pretest": "npm run build",
"test": "mocha -r test/setup.js --compilers js:babel-core/register 'test/**/*.js'"
},
"repository": {
"type": "git",
"url": "https://github.com/nteract/notebook-preview.git"
"url": "git+https://github.com/nteract/notebook-preview.git"
},
"keywords": [
"react",
"reactjs",
"notebook",
"nteract",
"jupyter",
"boilerplate"
],
"author": "Kyle Kelley <rgbkrk@gmail.com> (https://github.com/rgbkrk)",
"license": "BSD-3-Clause",
"author": "Kyle Kelley <rgbkrk@gmail.com>",
"license": "MPL-2.0",
"bugs": {
"url": "https://github.com/nteract/notebook-preview/issues"
},
"homepage": "https://github.com/nteract/notebook-preview",
"homepage": "https://github.com/nteract/notebook-preview#readme",
"devDependencies": {
"babel-core": "^6.0.20",
"babel-eslint": "^4.1.3",
"babel-loader": "^6.0.1",
"babel-preset-es2015": "^6.0.15",
"babel-preset-react": "^6.0.15",
"babel-preset-stage-0": "^6.0.15",
"eslint-plugin-react": "^3.6.2",
"github-api": "^0.11.2",
"json-loader": "^0.5.4",
"react-hot-loader": "^1.3.0",
"webpack": "^1.12.2",
"webpack-dev-server": "^1.12.1"
"babel-cli": "^6.7.7",
"babel-core": "^6.7.7",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"chai": "^3.5.0",
"enzyme": "^2.2.0",
"immutable": "^3.8.1",
"jsdom": "^8.4.0",
"mocha": "^2.4.5",
"nyc": "^6.4.0",
"react": "^15.0.1",
"react-addons-test-utils": "^15.0.1",
"react-dom": "^15.0.1"
},
"peerDependencies": {
"react": "^15.0.1",
"react-dom": "^15.0.1"
},
"dependencies": {
"commutable": "^0.1.3",
"immutable": "^3.7.6",
"prismjs": "^1.3.0",
"react": "^0.14.0",
"react-addons-pure-render-mixin": "^0.14.6",
"react-dom": "^0.14.0",
"react-jupyter-display-area": "0.0.1",
"react-prism": "^3.1.0"
"codemirror": "^5.14.2",
"commutable": "^0.6.0",
"react-codemirror": "^0.2.6",
"react-jupyter-display-area": "^0.4.0",
"remark": "^4.2.2",
"remark-react": "^2.0.0",
"transformime-react": "^0.6.0"
}
}

@@ -1,14 +0,2 @@

notebook-preview
=====================
Prototype preview of the notebook, relying on React components from nteract.
### Usage
```
npm install
npm start
open http://localhost:3000
```
Now edit `src/index.js`.
# notebook-preview
Lightweight preview of a notebook, nteract style

@@ -1,59 +0,3 @@

import React from 'react';
import ReactDOM from 'react-dom';
import Notebook from './components/notebook';
import StaticNotebook from './StaticNotebook';
import * as commutable from 'commutable';
// For demo sake
const demoGistID = '43d6dfc8ab43cb9c04fd';
const GitHub = require('github-api');
const gh = new GitHub({});
const gistAPI = gh.getGist(demoGistID);
function readNotebook(gist) {
return new Promise((resolve, reject) => {
gistAPI.read((err, gist) => {
if (err) {
reject(err);
return
}
for (let filename in gist.files) {
if(!gist.files.hasOwnProperty(filename)) {
continue;
}
const file = gist.files[filename];
filename = filename.toLowerCase();
// Ignore non-.ipynb
if(!filename.includes('.ipynb')) {
continue;
}
// We're just taking the first for this demo
resolve(file);
return;
}
});
})
.then((file) => {
if(file.truncated) {
return fetch(file.raw_url);
}
return file.content;
})
.then((content) => {
return JSON.parse(content);
})
}
readNotebook(demoGistID)
.then((notebook) => {
return commutable.fromJS(notebook);
})
.then((notebook) => {
ReactDOM.render(<StaticNotebook notebook={notebook} />, document.getElementById('root'));
}).catch(err => {
console.error(err);
})
export default Notebook;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc