Merge pull request #116 from jtpio/mimerender

Mime Extensions
Jeremy Tuloup 5 years ago committed by GitHub
commit 3cd1de3c34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -69,8 +69,15 @@ async function main() {
// load extra packages
require('@jupyterlab/celltags');
const mimeExtensions = [
require('@jupyterlab/javascript-extension'),
require('@jupyterlab/json-extension'),
require('@jupyterlab/pdf-extension'),
require('@jupyterlab/vega5-extension')
];
const App = require('@jupyterlab-classic/application').App;
const app = new App();
const app = new App({ mimeExtensions });
const disabled = [];
// TODO: formalize the way the set of initial extensions and plugins are specified

@ -41,6 +41,8 @@
"@jupyterlab/filebrowser": "~3.0.7",
"@jupyterlab/fileeditor": "~3.0.7",
"@jupyterlab/fileeditor-extension": "~3.0.7",
"@jupyterlab/javascript-extension": "~3.0.8",
"@jupyterlab/json-extension": "~3.0.7",
"@jupyterlab/mainmenu": "~3.0.5",
"@jupyterlab/mainmenu-extension": "~3.0.7",
"@jupyterlab/mathjax2-extension": "~3.0.7",
@ -48,6 +50,7 @@
"@jupyterlab/notebook-extension": "~3.0.7",
"@jupyterlab/observables": "~4.0.3",
"@jupyterlab/outputarea": "~3.0.6",
"@jupyterlab/pdf-extension": "~3.0.7",
"@jupyterlab/rendermime": "~3.0.6",
"@jupyterlab/rendermime-extension": "~3.0.7",
"@jupyterlab/rendermime-interfaces": "~3.0.5",
@ -64,6 +67,7 @@
"@jupyterlab/tooltip": "~3.0.6",
"@jupyterlab/tooltip-extension": "~3.0.7",
"@jupyterlab/ui-components": "~3.0.4",
"@jupyterlab/vega5-extension": "~3.0.7",
"@lumino/algorithm": "~1.3.3",
"@lumino/application": "~1.16.0",
"@lumino/commands": "~1.12.0",
@ -95,16 +99,20 @@
"@jupyterlab/coreutils": "~5.0.0",
"@jupyterlab/docmanager-extension": "^3.0.0",
"@jupyterlab/fileeditor-extension": "^3.0.0",
"@jupyterlab/javascript-extension": "^3.0.0",
"@jupyterlab/json-extension": "^3.0.0",
"@jupyterlab/mainmenu-extension": "^3.0.0",
"@jupyterlab/mathjax2-extension": "^3.0.0",
"@jupyterlab/notebook-extension": "^3.0.0",
"@jupyterlab/pdf-extension": "^3.0.0",
"@jupyterlab/rendermime-extension": "^3.0.0",
"@jupyterlab/running-extension": "^3.0.0",
"@jupyterlab/shortcuts-extension": "^3.0.0",
"@jupyterlab/terminal-extension": "^3.0.0",
"@jupyterlab/theme-dark-extension": "^3.0.0",
"@jupyterlab/theme-light-extension": "^3.0.0",
"@jupyterlab/tooltip-extension": "^3.0.0"
"@jupyterlab/tooltip-extension": "^3.0.0",
"@jupyterlab/vega5-extension": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.11.6",

@ -46,6 +46,7 @@
"@jupyterlab/application": "^3.0.0",
"@jupyterlab/coreutils": "^5.0.0",
"@jupyterlab/docregistry": "^3.0.0",
"@jupyterlab/rendermime-interfaces": "^3.0.0",
"@jupyterlab/ui-components": "^3.0.0",
"@lumino/algorithm": "^1.3.3",
"@lumino/coreutils": "^1.5.3",

@ -6,8 +6,12 @@ import {
JupyterFrontEndPlugin
} from '@jupyterlab/application';
import { createRendermimePlugins } from '@jupyterlab/application/lib/mimerenderers';
import { PageConfig } from '@jupyterlab/coreutils';
import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
import { Throttler } from '@lumino/polling';
import { IClassicShell, ClassicShell } from './shell';
@ -26,6 +30,11 @@ export class App extends JupyterFrontEnd<IClassicShell> {
...options,
shell: options.shell ?? new ClassicShell()
});
if (options.mimeExtensions) {
for (const plugin of createRendermimePlugins(options.mimeExtensions)) {
this.registerPlugin(plugin);
}
}
void this._formatter.invoke();
}
@ -135,7 +144,19 @@ export namespace App {
/**
* The instantiation options for an App application.
*/
export type IOptions = JupyterFrontEnd.IOptions<IClassicShell>;
export interface IOptions
extends JupyterFrontEnd.IOptions<IClassicShell>,
Partial<IInfo> {}
/**
* The information about a JupyterLab Classic application.
*/
export interface IInfo {
/**
* The mime renderer extensions.
*/
readonly mimeExtensions: IRenderMime.IExtensionModule[];
}
/**
* The interface for a module that exports a plugin or plugins as

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save