The renderer processes a ProjectReflection using a Theme instance and writes the emitted html documents to a output directory. You can specify which theme should be used using the --theme <name> command line argument.

Renderer is a subclass of EventDispatcher and triggers a series of events while a project is being processed. You can listen to these events to control the flow or manipulate the output.

  • EVENT_BEGIN
    Triggered before the renderer starts rendering a project. The listener receives an instance of RendererEvent. By calling preventDefault the entire render process can be canceled.

    • EVENT_BEGIN_PAGE
      Triggered before a document will be rendered. The listener receives an instance of PageEvent. By calling preventDefault the generation of the document can be canceled.

    • EVENT_END_PAGE
      Triggered after a document has been rendered, just before it is written to disc. The listener receives an instance of PageEvent. When calling preventDefault the the document will not be saved to disc.

  • EVENT_END
    Triggered after the renderer has written all documents. The listener receives an instance of RendererEvent.

  • EVENT_PREPARE_INDEX
    Triggered when the JavascriptIndexPlugin is preparing the search index. Listeners receive an instance of IndexEvent.

Hierarchy

  • ChildableComponent<Application, RendererComponent>
    • Renderer

Constructors

Properties

cleanOutputDir: boolean
cname: string
componentName: string

The name of this component as set by the

Component

decorator.

darkTheme: Theme
githubPages: boolean

Hooks which will be called when rendering pages. Note:

  • Hooks added during output will be discarded at the end of rendering.
  • Hooks added during a page render will be discarded at the end of that page's render.

See RendererHooks for a description of each available hook, and when it will be called.

lightTheme: Theme
themeName: string
theme?: Theme

The theme that is used to render the documentation.

Events

EVENT_BEGIN: "beginRender" = RendererEvent.BEGIN
EVENT_BEGIN_PAGE: "beginPage" = PageEvent.BEGIN
EVENT_END: "endRender" = RendererEvent.END
EVENT_END_PAGE: "endPage" = PageEvent.END
EVENT_PREPARE_INDEX: "prepareIndex" = IndexEvent.PREPARE_INDEX

Accessors

Methods

  • Type Parameters

    • T extends RendererComponent<T>

    Parameters

    • name: string
    • componentClass: T | ComponentClass<T, Application>

    Returns T

  • Adds a new resolver that the theme can use to try to figure out how to link to a symbol declared by a third-party library which is not included in the documentation.

    Since

    0.22.0

    Deprecated

    Deprecated since v0.23.14, use Converter.addUnknownSymbolResolver instead. This signature will be removed in 0.24 or possibly 0.25.

    Parameters

    • packageName: string

      the npm package name that this resolver can handle to limit which files it will be tried on. If the resolver will create links for Node builtin types, it should be set to @types/node. Links for builtin types live in the default lib files under typescript.

    • resolver: ((name: string) => undefined | string)

      a function that will be called to create links for a given symbol name in the registered path. If the provided name is not contained within the docs, should return undefined.

        • (name: string): undefined | string
        • Parameters

          • name: string

          Returns undefined | string

    Returns void

  • Define a new theme that can be used to render output. This API will likely be changing at some point, to allow more easily overriding parts of the theme without requiring additional boilerplate.

    Parameters

    Returns void

  • Retrieve a plugin instance.

    Returns

    The instance of the plugin or undefined if no plugin with the given class is attached.

    Parameters

    • name: string

    Returns undefined | RendererComponent

  • Returns RendererComponent[]

  • Parameters

    • name: string

    Returns boolean

  • Bind an event to only be triggered a single time. After the first time the callback is invoked, its listener will be removed. If multiple events are passed in using the space-separated syntax, the handler will fire once for each event, not once for a combination of all events.

    Parameters

    • eventMap: EventMap
    • Optional context: any

    Returns Renderer

  • Parameters

    • name: string
    • callback: EventCallback
    • Optional context: any
    • Optional priority: any

    Returns Renderer

  • Parameters

    • name: string

    Returns undefined | RendererComponent

  • Render the given project reflection to the specified output directory.

    Parameters

    • project: ProjectReflection

      The project that should be rendered.

    • outputDirectory: string

      The path of the directory the documentation should be rendered to.

    Returns Promise<void>

  • Trigger one or many events, firing all bound callbacks. Callbacks are passed the same arguments as trigger is, apart from the event name (unless you're listening on "all", which will cause your callback to receive the true name of the event as the first argument).

    Parameters

    Returns Renderer

Generated using TypeDoc