Permalink
Find file
4ed19cb Apr 21, 2016
40 lines (24 sloc) 1.28 KB

apiDoc Hooks

If you need a hook in apidoc-core please add your hook and provide a pull request.

How to add a hook into apidoc-core view source code.

How to use hook in your plugin view (https://github.com/apidoc/apidoc-plugin-test/blob/master/index.js)

parser-find-elements

Called on each found element. Returns a new list of elements (replace elements). Used to inject annotationes from an external schema.

Parameter: (elements, element, block, filename)

  • {array} elements Found elements in a block without the current element.
  • {array} element Contains the source, name (lowercase), sourceName (original), content.
  • {string} block Current source block.
  • {string} filename Current filename.

File: parser.js Function: _findElements

parser-find-element-{name}

Called on each found element and returns the modified element. Used to modify a specific element.

{name} is the found element.name (lowercase).

Parameter: (element, block, filename)

  • {array} element Contains the source, name (lowercase), sourceName (original), content.
  • {string} block Current source block.
  • {string} filename Current filename.

File: parser.js Function: _findElements