Browse Source

Merge pull request #93 from blink1073/update-notebook-ver

Update notebook, use its css, and clean up example handling
Dave Willmer 9 years ago
parent
commit
bf52df0f30

+ 1 - 1
examples/lab/index.js

@@ -4,7 +4,7 @@
 
 var phosphide = require('phosphide/lib/core/application');
 
-require('./build/index.css');
+require('jupyter-js-plugins/lib/default-theme/index.css');
 
 
 var app = new phosphide.Application({

+ 9 - 2
examples/lab/package.json

@@ -6,12 +6,19 @@
     "phosphide": "^0.9.0"
   },
   "scripts": {
-    "build": "cd .. && npm run build:example",
-    "postinstall": "npm dedupe"
+    "build": "webpack --config webpack.conf.js",
+    "clean": "rimraf build && rimraf node_modules",
+    "postinstall": "npm dedupe",
+    "update": "rimraf node_modules/jupyter-js-ui && npm install",
+    "watch:src": "watch 'npm run build' src --wait 5",
+    "watch": "concurrently 'npm run watch:src' 'python main.py'"
   },
   "devDependencies": {
+    "concurrently": "^2.0.0",
     "css-loader": "^0.23.1",
+    "rimraf": "^2.5.2",
     "style-loader": "^0.13.0",
+    "watch": "^0.17.1",
     "webpack": "^1.12.14"
   }
 }

+ 6 - 3
package.json

@@ -8,7 +8,7 @@
     "codemirror": "^5.10.0",
     "jquery": "^2.2.0",
     "jquery-ui": "^1.10.5",
-    "jupyter-js-notebook": "^0.7.1",
+    "jupyter-js-notebook": "^0.7.2",
     "jupyter-js-services": "^0.5.0",
     "jupyter-js-ui": "^0.0.3",
     "jupyter-js-utils": "^0.3.0",
@@ -42,12 +42,13 @@
     "typedoc": "^0.3.12",
     "typescript": "^1.7.5",
     "url-loader": "^0.5.7",
+    "watch": "^0.17.1",
     "webpack": "^1.12.11"
   },
   "scripts": {
     "clean": "rimraf docs && rimraf lib && rimraf test/build",
     "clean:example": "rimraf example/build",
-    "build:example": "node scripts/copythemecss.js && cd example && rimraf node_modules/jupyter-js-plugins && npm install && webpack --config webpack.conf.js",
+    "build:example": "cd example && npm run update && npm run build",
     "build:src": "tsc --project src && node scripts/copycss.js",
     "build:test": "tsc --project test/src && webpack --config test/webpack.conf.js",
     "build": "npm run build:src && npm run build:test",
@@ -59,7 +60,9 @@
     "test:firefox": "karma start --browsers=Firefox test/karma.conf.js",
     "test:ie": "karma start --browsers=IE test/karma.conf.js",
     "test:debug": "karma start --browsers=Chrome --singleRun=false --debug=true test/karma.conf.js",
-    "test": "npm run test:firefox"
+    "test": "npm run test:firefox",
+    "watch:example": "watch 'npm run build && npm run build:example' src --wait 10",
+    "watch": "watch 'npm run build' src"
   },
   "repository": {
     "type": "git",

+ 0 - 2
scripts/copythemecss.js

@@ -1,2 +0,0 @@
-var fs = require('fs-extra');
-fs.copySync('src/default-theme/', 'example/build/');

+ 2 - 48
src/default-theme/index.css

@@ -2,11 +2,12 @@
 | Copyright (c) Jupyter Development Team.
 | Distributed under the terms of the Modified BSD License.
 |----------------------------------------------------------------------------*/
+@import url('~jupyter-js-notebook/lib/index.css');
+@import url('~jupyter-js-notebook/lib/theme.css');
 @import url('~jupyter-js-ui/lib/index.css');
 @import url('~jupyter-js-ui/lib/theme.css');
 @import './commandpalette.css';
 @import './help.css';
-@import './notebook.css';
 
 body {
   margin: 0;
@@ -364,50 +365,3 @@ body {
 .p-Menu-item.p-type-submenu > .p-Menu-itemSubmenuIcon::before {
   content: '\f0da';
 }
-
-
-.CodeMirror.cm-s-default {
-  line-height: 1.21429em;
-  /* Changed from 1em to our global default */
-  font-size: 14px;
-  height: auto;
-  /* Changed to auto to autogrow */
-  background: none;
-  /* Changed from white to allow our bg to show through */
-}
-
-
-.CodeMirror-scroll {
-  /*  The CodeMirror docs are a bit fuzzy on if overflow-y should be hidden or visible.*/
-  /*  We have found that if it is visible, vertical scrollbars appear with font size changes.*/
-  overflow-y: hidden;
-  overflow-x: auto;
-}
-
-
-.CodeMirror-lines {
-  /* In CM2, this used to be 0.4em, but in CM3 it went to 4px. We need the em value because */
-  /* we have set a different line-height and want this to scale with that. */
-  padding: 0.4em;
-}
-
-
-.CodeMirror-linenumber {
-  padding: 0 8px 0 4px;
-}
-
-
-
-.CodeMirror-gutters {
-  border-bottom-left-radius: 2px;
-  border-top-left-radius: 2px;
-}
-
-
-.CodeMirror pre {
-  /* In CM3 this went to 4px from 0 in CM2. We need the 0 value because of how we size */
-  /* .CodeMirror-lines */
-  padding: 0;
-  border: 0;
-  border-radius: 0;
-}

+ 0 - 58
src/default-theme/notebook.css

@@ -1,58 +0,0 @@
-/*-----------------------------------------------------------------------------
-| Copyright (c) Jupyter Development Team.
-| Distributed under the terms of the Modified BSD License.
-|----------------------------------------------------------------------------*/
-
-/* Increased specificity in case phosphor css is loaded later. */
-.p-Widget.jp-NotebookContainer {
-  overflow: auto;
-}
-
-
-.p-Widget.jp-Notebook {  
-  min-width: 50px;
-  min-height: 50px;
-}
-
-
-.jp-InputArea > .jp-CodeMirror {
-  border: 1px solid #cfcfcf;
-  border-radius: 2px;
-  background: #f7f7f7;
-  line-height: 1.21429em;
-}
-
-
-.jp-MarkdownCell {
-  outline: 0;
-}
-
-
-.jp-OutputArea pre {
-  background: #ffffff;
-  border: none;
-}
-
-
-.jp-Cell.jp-mod-selected {
-  border-color: #66BB6A;
-  border-left-width: 1px;
-  padding-left: 10px;
-  background: linear-gradient(to right, #66BB6A -40px, #66BB6A 5px, transparent 5px, transparent 100%);
-}
-
-
-.jp-Cell {
-  padding-top: 10px;
-  padding-bottom: 10px;
-  padding-left: 10px;
-  padding-right: 10px;
-  border-width: 1px;
-  border-style: solid;
-  border-color: transparent;
-}
-
-
-.jp-MarkdownCell {
-  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-}