Compiler Class

Defined in: lib/Compiler.js

The module that compiles the docs.

Public Functions

voidon(String, Function)
voidoff(String, Function)
voidrun(Function, Object)

Constructor Documentation

Compiler(config: Object)

Parameters (1)

config
Object

megadoc options.

Static Property Documentation

  • assets: Assets

    The asset registry.

  • config: Config

    The config that was supplied by the user.

  • corpus: Corpus

    The corpus for this compilation.

  • linkResolver: LinkResolver

    The link resolver for this compilation and corpus.

  • renderer: Renderer

    The renderer instance configured for this compilation.

  • utils: AssetUtils

    A set of path-sensitive utils that take the user-configuration into account.

Instance Method Documentation

    off(event: String, callback: Function)

    Remove a previously registered event handler.

    Parameters (2)

    event
    String

    The event you previously bound to.

    callback
    Function

    The exact callback you passed in Compiler#on, including the context binding if any.

    on(event: String, callback: Function)

    Register a compilation event handler.

    Parameters (2)

    event
    String

    The event to bind to.

    callback
    Function

    run(done: Function, runOptions: Object)

    Perform the compilation.

    Parameters (4)

    done
    Function

    Callback to invoke when the compilation is complete.

    done.err
    String|Error

    If present, the compilation has failed. This parameter provides some context around the failure.

    runOptions
    Object

    A set of options to control the compilation.

    runOptions.stats
    Boolean

    Turn this on if you want to generate compile-time statistics.

    Defaults to: false