From 74e227b7d6998f9535b0ce17860a7e0dbd697e87 Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Mon, 17 Oct 2022 13:58:59 +0200 Subject: [PATCH] Fix PDF renderer --- app/package.json | 1 + packages/application/src/app.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/app/package.json b/app/package.json index a642e94521..2a814c6638 100644 --- a/app/package.json +++ b/app/package.json @@ -203,6 +203,7 @@ "@jupyterlab/mathjax2-extension", "@jupyterlab/markedparser-extension", "@jupyterlab/notebook-extension", + "@jupyterlab/pdf-extension", "@jupyterlab/rendermime-extension", "@jupyterlab/running-extension", "@jupyterlab/shortcuts-extension", diff --git a/packages/application/src/app.ts b/packages/application/src/app.ts index 5f1acc1e62..b11430932d 100644 --- a/packages/application/src/app.ts +++ b/packages/application/src/app.ts @@ -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 { */ 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);