How to use the @jupyterlab/markdownviewer.MarkdownViewer.defaultConfig function in @jupyterlab/markdownviewer

To help you get started, we’ve selected a few @jupyterlab/markdownviewer 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-data-explorer / jupyterlab / packages / markdownviewer-extension / src / index.ts View on Github external
restorer: ILayoutRestorer,
  rendermime: IRenderMimeRegistry,
  settingRegistry: ISettingRegistry
): IMarkdownViewerTracker {
  const { commands, docRegistry } = app;

  // Add the markdown renderer factory.
  rendermime.addFactory(markdownRendererFactory);

  const namespace = 'markdownviewer-widget';
  const tracker = new InstanceTracker({
    namespace
  });

  let config: Partial = {
    ...MarkdownViewer.defaultConfig
  };

  /**
   * Update the settings of a widget.
   */
  function updateWidget(widget: MarkdownViewer): void {
    Object.keys(config).forEach((k: keyof MarkdownViewer.IConfig) => {
      widget.setOption(k, config[k]);
    });
  }

  /**
   * Update the setting values.
   */
  function updateSettings(settings: ISettingRegistry.ISettings) {
    config = settings.composite as Partial;

@jupyterlab/markdownviewer

JupyterLab - Markdown viewer Widget

BSD-3-Clause
Latest version published 19 days ago

Package Health Score

95 / 100
Full package analysis