Skip to content

Commit 608e884

Browse files
committed
Added support for returns tag.
Added new Handlebars helper ifCondMatch.
1 parent 42c43e1 commit 608e884

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

lib/helpers.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ module.exports = function (hbs) {
66
return a === b ? options.fn(this) : options.inverse(this);
77
});
88

9+
hbs.registerHelper('ifCondMatch', function (a, b, options) {
10+
return String(a).match(new RegExp(b, 'i')) ? options.fn(this) : options.inverse(this);
11+
});
12+
913
hbs.registerHelper('formatName', function (name) {
1014
return String(name).replace(/\.prototype/g, '');
1115
});

templates/bootstrap.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ pre .hljs {
268268

269269
{{#each tags}}
270270

271-
{{#ifCond type "return"}}
271+
{{#ifCondMatch type "return"}}
272272

273273
<p>{{#each types}}<code>{{.}}</code> {{/each}} {{{description}}}</p>
274274

275-
{{/ifCond}}
275+
{{/ifCondMatch}}
276276

277277
{{/each}}
278278

templates/markdown.hbs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
{{{string}}}
4949
```{{/ifCond}}{{/each}}
5050

51+
###Returns
52+
53+
{{#each tags}}{{#ifCondMatch type "return"}}
54+
{{#each types}}`{{.}}` {{/each}} {{{description}}}
55+
{{/ifCondMatch}}{{/each}}
56+
5157
{{/if}}{{/unless}}{{/each}}{{/each}}
5258

5359
_Documentation generated with [doxdox](https://github.com/neogeek/doxdox)._

0 commit comments

Comments
 (0)