How to use the @jupyterlab/rendermime.RenderMimeRegistry.UrlResolver function in @jupyterlab/rendermime

To help you get started, we’ve selected a few @jupyterlab/rendermime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / packages / console / src / panel.ts View on Github external
options.contentFactory || ConsolePanel.defaultContentFactory);
    let count = Private.count++;
    if (!path) {
      path = `${basePath || ''}/console-${count}-${UUID.uuid4()}`;
    }

    let session = (this._session = new ClientSession({
      manager: manager.sessions,
      path,
      name: name || `Console ${count}`,
      type: 'console',
      kernelPreference: options.kernelPreference,
      setBusy: options.setBusy
    }));

    let resolver = new RenderMimeRegistry.UrlResolver({
      session,
      contents: manager.contents
    });
    rendermime = rendermime.clone({ resolver });

    this.console = contentFactory.createConsole({
      rendermime,
      session,
      mimeTypeService,
      contentFactory
    });
    this.addWidget(this.console);

    void session.initialize().then(() => {
      this._connected = new Date();
      this._updateTitle();
github jupyterlab / jupyterlab / packages / docregistry / src / context.ts View on Github external
return this._populatedPromise.promise;
    });

    let ext = PathExt.extname(this._path);
    this.session = new ClientSession({
      manager: manager.sessions,
      path: this._path,
      type: ext === '.ipynb' ? 'notebook' : 'file',
      name: PathExt.basename(localPath),
      kernelPreference: options.kernelPreference || { shouldStart: false },
      setBusy: options.setBusy
    });
    this.session.propertyChanged.connect(this._onSessionChanged, this);
    manager.contents.fileChanged.connect(this._onFileChanged, this);

    this.urlResolver = new RenderMimeRegistry.UrlResolver({
      session: this.session,
      contents: manager.contents
    });
  }
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / console / src / panel.ts View on Github external
options.contentFactory || ConsolePanel.defaultContentFactory);
    let count = Private.count++;
    if (!path) {
      path = `${basePath || ''}/console-${count}-${UUID.uuid4()}`;
    }

    let session = (this._session = new ClientSession({
      manager: manager.sessions,
      path,
      name: name || `Console ${count}`,
      type: 'console',
      kernelPreference: options.kernelPreference,
      setBusy: options.setBusy
    }));

    let resolver = new RenderMimeRegistry.UrlResolver({
      session,
      contents: manager.contents
    });
    rendermime = rendermime.clone({ resolver });

    this.console = contentFactory.createConsole({
      rendermime,
      session,
      mimeTypeService,
      contentFactory,
      modelFactory
    });
    this.addWidget(this.console);

    void session.initialize().then(() => {
      this._connected = new Date();
github jupyterlab / jupyterlab / packages / docregistry / src / context.ts View on Github external
return this._populatedPromise.promise;
    });

    let ext = PathExt.extname(this._path);
    this.session = new ClientSession({
      manager: manager.sessions,
      path: this._path,
      type: ext === '.ipynb' ? 'notebook' : 'file',
      name: PathExt.basename(localPath),
      kernelPreference: options.kernelPreference || { shouldStart: false },
      setBusy: options.setBusy
    });
    this.session.propertyChanged.connect(this._onSessionChanged, this);
    manager.contents.fileChanged.connect(this._onFileChanged, this);

    this.urlResolver = new RenderMimeRegistry.UrlResolver({
      session: this.session,
      contents: manager.contents
    });
  }
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / docregistry / src / context.ts View on Github external
path: this._path,
      type: ext === '.ipynb' ? 'notebook' : 'file',
      name: PathExt.basename(localPath),
      kernelPreference: options.kernelPreference || { shouldStart: false },
      setBusy: options.setBusy
    });
    this.session.propertyChanged.connect(
      this._onSessionChanged,
      this
    );
    manager.contents.fileChanged.connect(
      this._onFileChanged,
      this
    );

    this.urlResolver = new RenderMimeRegistry.UrlResolver({
      session: this.session,
      contents: manager.contents
    });
  }