Options
All
  • Public
  • Public/Protected
  • All
Menu

An object which manages mime renderer factories. The namespace for RenderMime class statics.

This object is used to render mime models using registered mime renderers, selecting the preferred mime renderer to render the model into a widget.

Notes

This class is not intended to be subclassed.

Hierarchy

  • RenderMime

Index

Constructors

constructor

Properties

Private _factories

_factories: Private.FactoryMap

Private _id

_id: number = 0

Private _latexTypesetter

_latexTypesetter: ILatexTypesetter

Private _ranks

_ranks: Private.RankMap

Private _types

_types: string[] | null = null

linkHandler

linkHandler: ILinkHandler | null

The object used to handle path opening links.

resolver

resolver: IResolver | null

The object used to resolve relative urls for the rendermime instance.

sanitizer

sanitizer: ISanitizer

The sanitizer used by the rendermime instance.

Accessors

latexTypesetter

  • The LaTeX typesetter for the rendermime.

    Notes

    This is settable so that extension authors may provide alternative implementations of the IRenderMime.ILatexTypesetter.

    Returns ILatexTypesetter

  • The LaTeX typesetter for the rendermime.

    Notes

    This is settable so that extension authors may provide alternative implementations of the IRenderMime.ILatexTypesetter.

    Parameters

    Returns void

mimeTypes

  • get mimeTypes(): ReadonlyArray<string>

Methods

addFactory

  • Add a renderer factory to the rendermime.

    Parameters

    • factory: IRendererFactory

      The renderer factory of interest.

    • Default value rank: number = 100

      The rank of the renderer. A lower rank indicates a higher priority for rendering. The default is 100.

      Notes

      The renderer will replace an existing renderer for the given mimeType.

    Returns void

clone

createModel

createRenderer

  • createRenderer(mimeType: string): IRenderer
  • Create a renderer for a mime type.

    throws

    An error if no factory exists for the mime type.

    Parameters

    • mimeType: string

      The mime type of interest.

    Returns IRenderer

    A new renderer for the given mime type.

getFactory

preferredMimeType

  • preferredMimeType(bundle: ReadonlyJSONObject, preferSafe: boolean): string | undefined
  • Find the preferred mime type for a mime bundle.

    Parameters

    • bundle: ReadonlyJSONObject

      The bundle of mime data.

    • preferSafe: boolean

      Whether to prefer a safe factory.

    Returns string | undefined

    The preferred mime type from the available factories, or undefined if the mime type cannot be rendered.

removeFactory

  • removeFactory(mimeType: string): void

Generated using TypeDoc