Merge pull request #6584 from brichet/fix/PDFrenderer

Fix PDF renderer
This commit is contained in:
Jeremy Tuloup 2022-10-17 14:54:50 +02:00 committed by GitHub
commit 71897fcda0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -207,6 +207,7 @@
"@jupyterlab/mathjax2-extension",
"@jupyterlab/markedparser-extension",
"@jupyterlab/notebook-extension",
"@jupyterlab/pdf-extension",
"@jupyterlab/rendermime-extension",
"@jupyterlab/running-extension",
"@jupyterlab/shortcuts-extension",

View File

@ -6,6 +6,8 @@ import {
JupyterFrontEndPlugin
} from '@jupyterlab/application';
import { Base64ModelFactory } from '@jupyterlab/docregistry';
import { createRendermimePlugins } from '@jupyterlab/application/lib/mimerenderers';
import { LabStatus } from '@jupyterlab/application/lib/status';
@ -29,6 +31,9 @@ export class NotebookApp extends JupyterFrontEnd<INotebookShell> {
*/
constructor(options: NotebookApp.IOptions = { shell: new NotebookShell() }) {
super({ ...options, shell: options.shell ?? new NotebookShell() });
// Add initial model factory.
this.docRegistry.addModelFactory(new Base64ModelFactory());
if (options.mimeExtensions) {
for (const plugin of createRendermimePlugins(options.mimeExtensions)) {
this.registerPlugin(plugin);