Namespace Object

Defined in: packages/megadoc-corpus/defs/core.js

Static Property Documentation

  • id: String!

    An identifier for this namespace that must be unique at this level in the corpus. The identifier is utilized in the generation of UIDs and will consequently effect the generated URLs and paths of the generated .html files.

  • name: String!

    A name to be used internally for the namespace. This property is meant to identify the "class" of the namespace; or in other words, the type of documents the namespace will contain.

    Since the Corpus does not allow you to define custom types and it may sometimes be necessary to identify where a certain document comes from, the name can be used in its place.

    The name can be shared, and is usually equal to the name of the plugin that is generating this namespace (e.g. "megadoc-plugin-markdown".)

  • title: String?

    A human-friendly title for display for this namespace. The title will be utilized in the UI any time we need to reference this namespace, like in the Spotlight or plugin root-level pages (aka "index" pages) that list all the documents available.

    Example values: "Articles" for a markdown namespace, "JavaScripts" for JS source files, "API" for Rails or Python API source files, etc.

    Defaults to: null

  • symbol: String?

    The symbol is used when generating UIDs for documents in the namespace; their UID will effectively be their T.Node@id delimited by this symbol.

    Usually, you would not need to customize the symbol at the namespace level and can safely leave it as "/".

    For example:

    / T.Namespace(X) T.Document(A)

    Document A above will have a UID of X/A.

    Defaults to: /

  • indexFields: Array.<String>

    Override the default T.Corpus@indexFields.

    A reason to override the default index fields may be that your documents should not be indexed by their file-paths for example, or that they may have additional fields that should be indexed, like is the case in the @alias tag for JavaScript sources; the documents there should be identified by either their original identifiers or one of their aliases.

    Defaults to: null

  • config: Object?

    A good place to inject the user config needed by the UI for your plugin.

  • documents: Array.<T.Document>
  • parentNodePRIVATE: T.Corpus

    This is automatically attached when you add the namespace to the corpus.

    Defaults to: "Corpus"