File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ var postProcessTags = require ( "./post-process" ) ;
2
+ var processTags = require ( "./process-tags" ) ;
3
+
4
+ module . exports = function ( bitDocs ) {
5
+ // this makes tags run
6
+ bitDocs . register ( "postProcessor" , postProcessTags ) ;
7
+ bitDocs . register ( "processor" , processTags ) ;
8
+ } ;
Original file line number Diff line number Diff line change
1
+
2
+ var _ = require ( 'lodash' ) ;
3
+
4
+ // for each tag that has a .done method, calls it on every item in the docMap
5
+ module . exports = function ( docMap , siteConfig ) {
6
+ var tags = siteConfig . tags
7
+ var dones = [ ] ;
8
+ for ( var tag in tags ) {
9
+ if ( tags [ tag ] . done ) {
10
+ dones . push ( tags [ tag ] . done ) ;
11
+ }
12
+ }
13
+ // some tags inherit methods other tags. We don't want to duplicate the same done behavior
14
+ dones = _ . uniq ( dones ) ;
15
+
16
+ for ( var name in docMap ) {
17
+ dones . forEach ( function ( done ) {
18
+ done . call ( docMap [ name ] ) ;
19
+ } ) ;
20
+ }
21
+ } ;
You can’t perform that action at this time.
0 commit comments