浏览代码

fixed examples, wrote docs

telamonian 5 年之前
父节点
当前提交
c3af854b9b

+ 2 - 1
examples/app/index.js

@@ -39,7 +39,8 @@ window.addEventListener('load', async function() {
     require('@jupyterlab/terminal-extension'),
     require('@jupyterlab/theme-dark-extension'),
     require('@jupyterlab/theme-light-extension'),
-    require('@jupyterlab/tooltip-extension')
+    require('@jupyterlab/tooltip-extension'),
+    require('@jupyterlab/ui-components-extension')
   ];
   var lab = new JupyterLab();
   lab.registerPluginModules(mods);

+ 11 - 6
examples/filebrowser/src/index.ts

@@ -21,19 +21,21 @@ import { ServiceManager } from '@jupyterlab/services';
 
 import { Dialog, ToolbarButton, showDialog } from '@jupyterlab/apputils';
 
-import { FileBrowser, FileBrowserModel } from '@jupyterlab/filebrowser';
+import {
+  CodeMirrorEditorFactory,
+  CodeMirrorMimeTypeService
+} from '@jupyterlab/codemirror';
 
 import { DocumentManager } from '@jupyterlab/docmanager';
 
 import { DocumentRegistry } from '@jupyterlab/docregistry';
 
-import {
-  CodeMirrorEditorFactory,
-  CodeMirrorMimeTypeService
-} from '@jupyterlab/codemirror';
+import { FileBrowser, FileBrowserModel } from '@jupyterlab/filebrowser';
 
 import { FileEditorFactory } from '@jupyterlab/fileeditor';
 
+import { defaultIconRegistry } from '@jupyterlab/ui-components';
+
 function main(): void {
   let manager = new ServiceManager();
   void manager.ready.then(() => {
@@ -85,7 +87,10 @@ function createApp(manager: ServiceManager.IManager): void {
 
   let commands = new CommandRegistry();
 
-  let fbModel = new FileBrowserModel({ manager: docManager });
+  let fbModel = new FileBrowserModel({
+    manager: docManager,
+    iconRegistry: defaultIconRegistry
+  });
   let fbWidget = new FileBrowser({
     id: 'filebrowser',
     model: fbModel

+ 2 - 77
packages/ui-components-extension/README.md

@@ -1,78 +1,3 @@
-# vdom-extension
+# @jupyterlab/ui-components-extension
 
-A JupyterLab extension for rendering VirtualDOM using React
-
-![demo](http://g.recordit.co/EIwAIBsGBh.gif)
-
-## Prerequisites
-
-- JupyterLab ^0.27.0
-
-## Usage
-
-To render VDOM output in IPython:
-
-```python
-from IPython.display import display
-
-def VDOM(data={}):
-    bundle = {}
-    bundle['application/vdom.v1+json'] = data
-    display(bundle, raw=True)
-
-VDOM({
-    'tagName': 'div',
-    'attributes': {},
-    'children': [{
-        'tagName': 'h1',
-        'attributes': {},
-        'children': 'Our Incredibly Declarative Example',
-        'key': 0
-    }, {
-        'tagName': 'p',
-        'attributes': {},
-        'children': ['Can you believe we wrote this ', {
-            'tagName': 'b',
-            'attributes': {},
-            'children': 'in Python',
-            'key': 1
-        }, '?'],
-        'key': 1
-    }, {
-        'tagName': 'img',
-        'attributes': {
-            'src': 'https://media.giphy.com/media/xUPGcguWZHRC2HyBRS/giphy.gif'
-        },
-        'key': 2
-    }, {
-        'tagName': 'p',
-        'attributes': {},
-        'children': ['What will ', {
-            'tagName': 'b',
-            'attributes': {},
-            'children': 'you',
-            'key': 1
-        }, ' create next?'],
-        'key': 3
-    }]
-})
-```
-
-Using the [vdom Python library](https://github.com/nteract/vdom):
-
-```python
-from vdom import h1, p, img, div, b
-
-div(
-    h1('Our Incredibly Declarative Example'),
-    p('Can you believe we wrote this ', b('in Python'), '?'),
-    img(src="https://media.giphy.com/media/xUPGcguWZHRC2HyBRS/giphy.gif"),
-    p('What will ', b('you'), ' create next?'),
-)
-```
-
-To render a `.vdom` or `.vdom.json` file, simply open it:
-
-## Development
-
-See the [JupyterLab Contributor Documentation](https://github.com/jupyterlab/jupyterlab/blob/master/CONTRIBUTING.md).
+A JupyterLab package that provides plugins that serve the UI elements produced by `@jupyterlab/ui-components`.

+ 1 - 1
packages/ui-components/README.md

@@ -1,3 +1,3 @@
 # @jupyterlab/ui-components
 
-A JupyterLab package that provides React UI components to core JupyterLab packages and third-party extensions.
+A JupyterLab package that provides UI elements of various types (React components, DOM elements, etc) to core JupyterLab packages and third-party extensions.