|
@@ -4,7 +4,7 @@ As an example: Add a leaflet viewer plugin for geoJSON files.
|
|
|
|
|
|
- Go to npm: search for [leaflet](https://www.npmjs.com/package/leaflet) (success!).
|
|
- Go to npm: search for [leaflet](https://www.npmjs.com/package/leaflet) (success!).
|
|
- Go to `jupyterlab` top level source directory: `jlpm add leaflet`. This adds the file to the `dependencies` in `package.json`.
|
|
- Go to `jupyterlab` top level source directory: `jlpm add leaflet`. This adds the file to the `dependencies` in `package.json`.
|
|
-- Next we see if there is a typing declaration for leaflet:
|
|
|
|
|
|
+- Next we see if there is a typing declaration for leaflet:
|
|
`jlpm add --dev @types/leaflet`. Success!
|
|
`jlpm add --dev @types/leaflet`. Success!
|
|
- If there are no typings, we must create our own. An example typings file that exports functions is [ansi_up](https://github.com/jupyterlab/jupyterlab/blob/master/packages/rendermime/typings/ansi_up/ansi_up.d.ts). An example with a class is [xterm](https://github.com/jupyterlab/jupyterlab/blob/master/packages/terminal/typings/xterm/xterm.d.ts).
|
|
- If there are no typings, we must create our own. An example typings file that exports functions is [ansi_up](https://github.com/jupyterlab/jupyterlab/blob/master/packages/rendermime/typings/ansi_up/ansi_up.d.ts). An example with a class is [xterm](https://github.com/jupyterlab/jupyterlab/blob/master/packages/terminal/typings/xterm/xterm.d.ts).
|
|
- Add a reference to the new library in `src/typings.d.ts`.
|
|
- Add a reference to the new library in `src/typings.d.ts`.
|
|
@@ -12,8 +12,8 @@ As an example: Add a leaflet viewer plugin for geoJSON files.
|
|
- Add `index.ts` and `plugin.ts` files.
|
|
- Add `index.ts` and `plugin.ts` files.
|
|
- If creating CSS, import them in `src/default-themes/index.css`.
|
|
- If creating CSS, import them in `src/default-themes/index.css`.
|
|
- The `index.ts` file should have the core logic for the plugin. In
|
|
- The `index.ts` file should have the core logic for the plugin. In
|
|
-this case, it should create a widget and widget factory for rendering geojson
|
|
|
|
-files (see [Documents](documents.md)).
|
|
|
|
|
|
+this case, it should create a widget and widget factory for rendering geojson
|
|
|
|
+files (see [Documents](documents.html)).
|
|
- The `plugin.ts` file should create the extension and add the content
|
|
- The `plugin.ts` file should create the extension and add the content
|
|
to the application. In this case registering the widget factory using
|
|
to the application. In this case registering the widget factory using
|
|
the document registry.
|
|
the document registry.
|