Tag.add typedef

Called for lines starting with @.

function(line, curData, scope, docMap, currentWrite, options)

Parameters

  1. line {String}:

    @ until newline.

  2. curData {DocObject|Object}:

    DocObject or custom object.

  3. scope {DocObject}:

    DocObject representing current scope.

  4. docMap {DocMap}:

    DocMap being added to.

  5. currentWrite {String}:

    HTML element to write to, such as body.

  6. options {siteConfig}:

    Global site options.

Returns

{ProcessTagsCommand|Object}:

Command or custom object.

Use

A stack is used to handle tags that might be nested, for example @codestart and @codeend. It provides something to collect data until the closing tag, and have the compiled data "popped" to the parent.

Return an array matching a ProcessTagsCommand to run a command on the stack. You can also return an object of your choosing to be used later by the tag addMore method to accumulate strings for example like bit-docs-js/tags/codestart.

curData might be a custom object in the case of for example bit-docs-js/tags/codeend where the custom data object was hydrated by bit-docs-js/tags/codestart.