import { KatexOptions } from 'katex'; import { MinimalElement, NbRenderer, NbRendererOpts as BaseOptions, Notebook } from 'ipynb2html-core'; import { MarkedOptions } from './markdownRenderer'; export { default as version } from './version'; export { default as readNotebookTitle } from './readNotebookTitle'; export { NbRenderer, Notebook }; export declare type NbRendererOpts = BaseOptions & { /** * The prefix to be used for all CSS class names except `lang-*`. * Default is `nb-`. */ classPrefix?: string; /** * Options for the KaTeX math renderer. Default is * `{ displayMode: true, throwOnError: false }`. The provided options will * be merged with the default. */ katexOpts?: KatexOptions; /** * Options for the marked Markdown renderer. */ markedOpts?: MarkedOptions; }; /** * Definition of the smallest possible subset of the Document type required * for this module's function. */ declare type MinimalDocument = { createElement: (tag: string) => TElement; }; /** * Builds a full-fledged Jupyter Notebook renderer. * * It supports rendering of Markdown cells with math (using marked and KaTeX), * code highlighting (using highlight.js), rendering of ANSI escape sequences * (using Anser) and SageMath-style math outputs. All of them may be overridden * via *opts*. * * It returns a "callable object" that exposes one renderer function for each * of the Notebook's AST nodes. You can easily replace any of the functions to * modify behaviour of the renderer. * * @example // Node.js * import * as fs from 'fs' * import * as ipynb from 'ipynb2html' * import { Document } from 'nodom' * * const renderNotebook = ipynb.createRenderer(new Document()) * const notebook = JSON.parse(fs.readFileSync('./example.ipynb', 'utf8')) * * console.log(renderNotebook(notebook).outerHTML) * * @example // Browser * const render = ipynb2html.createRenderer(document) * document.body.appendChild(render(notebook)) * * @param document The `Document` object from the browser's native DOM or any * fake/virtual DOM library (e.g. nodom). The only required method is * `createElement`. * @param opts The renderer options. * @return A configured instance of the Notebook renderer. */ export declare function createRenderer(document: MinimalDocument, opts?: NbRendererOpts): NbRenderer; //# sourceMappingURL=index.d.ts.map