-
Notifications
You must be signed in to change notification settings - Fork 0
/
bit-docs.js
41 lines (40 loc) · 1.41 KB
/
bit-docs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var postProcessTags = require("./post-process");
var processTags = require("./process-tags");
var _ = require("lodash");
/**
* @parent plugins
* @module {function} bit-docs-process-tags
* @group bit-docs-process-tags/tags tags
* @group bit-docs-process-tags/types types
* @group bit-docs-process-tags/modules modules
*
* @description Processes tags for a docMap.
*
* @body
*
* This plugin registers onto these hooks:
* - `processor`
* - `postProcessor`
*
* This plugin handles the `tags` hook, and in doing so also adds some tags:
* - [bit-docs-process-tags/tags/add @add]
* - [bit-docs-process-tags/tags/body @body]
* - [bit-docs-process-tags/tags/description @description]
* - [bit-docs-process-tags/tags/hide @hide]
* - [bit-docs-process-tags/tags/parent @parent]
*
* Registering the `processor` hook adds a general processor that processes a
* code comments and produces a [bit-docs/types/docObject] from the tags found.
*
* Registering the `postProcessor` hook adds a special processor that calls the
* `done` method of any tags that have such a method, passing the
* [bit-docs/types/docObject].
*/
module.exports = function(bitDocs){
// this makes tags run
bitDocs.register("postProcessor", postProcessTags);
bitDocs.register("processor", processTags);
bitDocs.handle("tags", function(siteConfig, tags){
siteConfig.tags = _.assign(siteConfig.tags || {}, tags);
});
};