File tree Expand file tree Collapse file tree 3 files changed +82
-1
lines changed Expand file tree Collapse file tree 3 files changed +82
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ var fs = require('fs'),
9
9
module . exports . templates = {
10
10
bootstrap : require ( '../templates/bootstrap.hbs' ) ,
11
11
markdown : require ( '../templates/markdown.hbs' ) ,
12
- dash : utils . buildDashDocSet
12
+ dash : utils . buildDashDocSet ,
13
+ wiki : utils . buildWiki
13
14
} ;
14
15
15
16
module . exports . parseInput = function ( input , config , pkg ) {
Original file line number Diff line number Diff line change @@ -98,6 +98,35 @@ module.exports.buildDashDocSet = function (input) {
98
98
99
99
} ;
100
100
101
+
102
+ module . exports . buildWiki = function ( input ) {
103
+
104
+ return new Promise ( function ( resolve ) {
105
+
106
+ var zip = new admzip ( ) ,
107
+ template = require ( '../templates/wiki/methods.hbs' ) ;
108
+
109
+ input . uid = module . exports . formatStringForUID ( input . title ) ;
110
+
111
+ input . files . forEach ( function ( file ) {
112
+
113
+ file . methods . forEach ( function ( method ) {
114
+
115
+ zip . addFile (
116
+ file . name + '/' + method . name + '.md' ,
117
+ template ( method )
118
+ ) ;
119
+
120
+ } ) ;
121
+
122
+ } ) ;
123
+
124
+ resolve ( zip . toBuffer ( ) ) ;
125
+
126
+ } ) ;
127
+
128
+ } ;
129
+
101
130
module . exports . findPackagePath = function ( input ) {
102
131
103
132
var pkg ,
Original file line number Diff line number Diff line change
1
+ #{{ name }} ({{ params }} ) {{ #if isPrivate }} _private method_{{ /if }}
2
+
3
+ {{{ description }}}
4
+
5
+ {{{ body }}}
6
+
7
+ {{ #if tags.param }}
8
+
9
+ ##Parameters
10
+
11
+ {{ #each tags.param }}
12
+ - **{{ name }} ** {{ #each types }} `{{ . }} ` {{ /each }} {{ #if isOptional }} _Optional_{{ /if }} {{{ description }}}
13
+ {{ /each }}
14
+
15
+ {{ /if }}
16
+
17
+ {{ #if tags.property }}
18
+
19
+ ##Properties
20
+
21
+ {{ #each tags.property }}
22
+ - **{{ name }} ** {{ #each types }} `{{ . }} ` {{ /each }} {{ #if isOptional }} _Optional_{{ /if }} {{{ description }}}
23
+ {{ /each }}
24
+
25
+ {{ /if }}
26
+
27
+ {{ #if tags.example }}
28
+
29
+ ##Examples
30
+
31
+ {{ #each tags.example }}
32
+ ```javascript
33
+ {{{ . }}}
34
+ ```
35
+ {{ /each }}
36
+
37
+ {{ /if }}
38
+
39
+ ##Returns
40
+
41
+ {{ #if tags.return }}
42
+
43
+ {{ #each tags.return }}
44
+ - {{ #each types }} `{{ . }} ` {{ /each }} {{ #if isOptional }} _Optional_{{ /if }} {{{ description }}}
45
+ {{ /each }}
46
+
47
+ {{ else }}
48
+
49
+ - `Void`
50
+
51
+ {{ /if }}
You can’t perform that action at this time.
0 commit comments