This repository was archived by the owner on May 1, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -62,3 +62,11 @@ Invokes the `psc-make` command.
62
62
- verboseErrors: Boolean value that toggles ` --verbose-errors `
63
63
- browserNamespace: String value that sets ` --browser-namespace=<string> `
64
64
- output: String value that sets ` --output=<string> `
65
+
66
+ ### purescript.docgen(options)
67
+
68
+ Invokes the ` docgen ` command.
69
+
70
+ #### options
71
+
72
+ - hierarchy: Boolean value that toggles ` --hierarchy-images `
Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ var gutil = require('gulp-util')
30
30
}
31
31
, single : { browserNamespace : '--browser-namespace' , output : '--output' }
32
32
, multi : { }
33
+ } ,
34
+ docgen : {
35
+ flags : {
36
+ hierarchy : '--hierarchy-images'
37
+ }
38
+ , single : { }
39
+ , multi : { }
33
40
}
34
41
}
35
42
;
@@ -115,7 +122,34 @@ function pscMake(opts) {
115
122
} ) ;
116
123
}
117
124
125
+ function docgen ( opts ) {
126
+ return acc ( function ( files , cb ) {
127
+ var args = options ( OPTIONS . docgen , opts ) . concat ( files )
128
+ , cmd = cp . spawn ( 'docgen' , args )
129
+ , buffer = new Buffer ( 0 )
130
+ , that = this
131
+ ;
132
+ cmd . stdout . on ( 'data' , function ( stdout ) {
133
+ buffer = Buffer . concat ( [ buffer , new Buffer ( stdout ) ] ) ;
134
+ } ) ;
135
+ cmd . stderr . on ( 'data' , function ( stderr ) {
136
+ gutil . log ( 'Stderr from \'' + gutil . colors . cyan ( 'docgen' ) + '\'\n' + gutil . colors . magenta ( stderr ) ) ;
137
+ } ) ;
138
+ cmd . on ( 'close' , function ( code ) {
139
+ if ( ! ! code ) that . emit ( 'error' , new gutil . PluginError ( PLUGIN , buffer . toString ( ) ) ) ;
140
+ else {
141
+ that . push ( new gutil . File ( {
142
+ path : '.' ,
143
+ contents : buffer
144
+ } ) ) ;
145
+ }
146
+ cb ( ) ;
147
+ } ) ;
148
+ } ) ;
149
+ }
150
+
118
151
module . exports = {
152
+ docgen : docgen ,
119
153
psc : psc ,
120
154
pscMake : pscMake
121
155
}
You can’t perform that action at this time.
0 commit comments