|
@@ -3,6 +3,7 @@
|
|
|
|
|
|
import {
|
|
import {
|
|
ILayoutRestorer,
|
|
ILayoutRestorer,
|
|
|
|
+ IMimeDocumentTracker,
|
|
JupyterLab,
|
|
JupyterLab,
|
|
JupyterLabPlugin,
|
|
JupyterLabPlugin,
|
|
} from '@jupyterlab/application';
|
|
} from '@jupyterlab/application';
|
|
@@ -21,6 +22,7 @@ import {
|
|
createLatexGenerator,
|
|
createLatexGenerator,
|
|
createNotebookGenerator,
|
|
createNotebookGenerator,
|
|
createMarkdownGenerator,
|
|
createMarkdownGenerator,
|
|
|
|
+ createRenderedMarkdownGenerator,
|
|
} from './generators';
|
|
} from './generators';
|
|
|
|
|
|
import {ITableOfContentsRegistry, TableOfContentsRegistry} from './registry';
|
|
import {ITableOfContentsRegistry, TableOfContentsRegistry} from './registry';
|
|
@@ -38,6 +40,7 @@ const extension: JupyterLabPlugin<ITableOfContentsRegistry> = {
|
|
IDocumentManager,
|
|
IDocumentManager,
|
|
IEditorTracker,
|
|
IEditorTracker,
|
|
ILayoutRestorer,
|
|
ILayoutRestorer,
|
|
|
|
+ IMimeDocumentTracker,
|
|
INotebookTracker,
|
|
INotebookTracker,
|
|
IRenderMimeRegistry,
|
|
IRenderMimeRegistry,
|
|
],
|
|
],
|
|
@@ -52,6 +55,7 @@ function activateTOC(
|
|
docmanager: IDocumentManager,
|
|
docmanager: IDocumentManager,
|
|
editorTracker: IEditorTracker,
|
|
editorTracker: IEditorTracker,
|
|
restorer: ILayoutRestorer,
|
|
restorer: ILayoutRestorer,
|
|
|
|
+ mimeDocumentTracker: IMimeDocumentTracker,
|
|
notebookTracker: INotebookTracker,
|
|
notebookTracker: INotebookTracker,
|
|
rendermime: IRenderMimeRegistry,
|
|
rendermime: IRenderMimeRegistry,
|
|
): ITableOfContentsRegistry {
|
|
): ITableOfContentsRegistry {
|
|
@@ -80,6 +84,13 @@ function activateTOC(
|
|
const markdownGenerator = createMarkdownGenerator(editorTracker);
|
|
const markdownGenerator = createMarkdownGenerator(editorTracker);
|
|
registry.addGenerator(markdownGenerator);
|
|
registry.addGenerator(markdownGenerator);
|
|
|
|
|
|
|
|
+ // Create an rendered markdown editor TableOfContentsRegistry.IGenerator
|
|
|
|
+ const renderedMarkdownGenerator = createRenderedMarkdownGenerator(
|
|
|
|
+ mimeDocumentTracker,
|
|
|
|
+ rendermime.sanitizer
|
|
|
|
+ );
|
|
|
|
+ registry.addGenerator(renderedMarkdownGenerator);
|
|
|
|
+
|
|
// Create a latex editor TableOfContentsRegistry.IGenerator
|
|
// Create a latex editor TableOfContentsRegistry.IGenerator
|
|
const latexGenerator = createLatexGenerator(editorTracker);
|
|
const latexGenerator = createLatexGenerator(editorTracker);
|
|
registry.addGenerator(latexGenerator);
|
|
registry.addGenerator(latexGenerator);
|