File tree Expand file tree Collapse file tree 3 files changed +46
-4
lines changed Expand file tree Collapse file tree 3 files changed +46
-4
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ module.exports.formatStringForName = function (content) {
113
113
114
114
content = String ( content ) ;
115
115
116
- content = content . replace ( / \. p r o t o t y p e / g, '' ) ;
116
+ content = content . replace ( / \. p r o t o t y p e | \( \) / g, '' ) ;
117
117
118
118
return content ;
119
119
@@ -136,7 +136,11 @@ module.exports.parseData = function (data, file) {
136
136
137
137
data . forEach ( function ( item ) {
138
138
139
- var method = { } ;
139
+ var method = { } ,
140
+ params = {
141
+ required : [ ] ,
142
+ optional : [ ]
143
+ } ;
140
144
141
145
if ( ! item . ignore && item . ctx ) {
142
146
@@ -185,6 +189,44 @@ module.exports.parseData = function (data, file) {
185
189
186
190
} ) ;
187
191
192
+ if ( method . tags . param ) {
193
+
194
+ method . tags . param . forEach ( function ( tag ) {
195
+
196
+ if ( ! tag . name . match ( / \. / ) ) {
197
+
198
+ if ( tag . isOptional ) {
199
+
200
+ params . optional . push ( tag . name ) ;
201
+
202
+ } else {
203
+
204
+ params . required . push ( tag . name ) ;
205
+
206
+ }
207
+
208
+ }
209
+
210
+ } ) ;
211
+
212
+ method . params = params . required . join ( ', ' ) ;
213
+
214
+ if ( params . optional . length ) {
215
+
216
+ if ( method . params ) {
217
+
218
+ method . params += '[, ' + params . optional . join ( ', ' ) + ']' ;
219
+
220
+ } else {
221
+
222
+ method . params += '[' + params . optional . join ( ', ' ) + ']' ;
223
+
224
+ }
225
+
226
+ }
227
+
228
+ }
229
+
188
230
methods . push ( method ) ;
189
231
190
232
}
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ pre .hljs {
270
270
<div class =" method scope-{{ #if isPrivate }} private{{ else }} public{{ /if }} " >
271
271
272
272
<h2 id =" {{ uid }} " >
273
- <a href =" #{{ uid }} " class =" permalink" >#</a > {{ name }}
273
+ <a href =" #{{ uid }} " class =" permalink" >#</a > {{ name }} ( {{ params }} )
274
274
{{ #if isPrivate }}
275
275
<small >private {{ type }} </small >
276
276
{{ /if }}
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ pre .hljs {
39
39
<div class =" method scope-{{ #if isPrivate }} private{{ else }} public{{ /if }} " >
40
40
41
41
<h2 id =" {{ uid }} " >
42
- {{ name }}
42
+ {{ name }} ( {{ params }} )
43
43
{{ #if isPrivate }}
44
44
<small >private {{ type }} </small >
45
45
{{ /if }}
You can’t perform that action at this time.
0 commit comments