Skip to content

Commit c3bd5b8

Browse files
committed
Merge branch 'edge'
2 parents d19f7d4 + 1ab30b2 commit c3bd5b8

File tree

6 files changed

+33
-11
lines changed

6 files changed

+33
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#Changelog
22

3+
##0.0.7 (August 18, 2014)
4+
5+
- Added support for examples tag.
6+
- Added support for returns tag.
7+
- Added both `bower_components` and `gulpfile` to default walk exceptions.
8+
39
##0.0.6 (August 17, 2014)
410

511
- Added support for custom Handlebars templates.

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
});

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module.exports.walk = function (dir, opts) {
6464
}
6565

6666
if (!opts.exception) {
67-
opts.exception = /\.git|\.min|node_modules|test|gruntfile/i;
67+
opts.exception = /\.git|\.min|node_modules|bower_components|test|gruntfile|gulpfile/i;
6868
}
6969

7070
if (fs.existsSync(dir) && fs.statSync(dir).isDirectory()) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "doxdox",
33
"description": "HTML and Markdown documentation generator.",
4-
"version": "0.0.6",
4+
"version": "0.0.7",
55
"bin": "./bin/doxdox",
66
"license": "MIT",
77
"dependencies": {

templates/bootstrap.hbs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,23 @@ pre .hljs {
238238

239239
{{/if}}
240240

241-
{{#if description.body}}
242-
243241
<section class="examples">
244242

245243
<h3>Examples</h3>
246244

247245
{{{description.body}}}
248246

249-
</section>
247+
{{#each tags}}
250248

251-
{{/if}}
249+
{{#ifCond type "example"}}
250+
251+
<pre><code>{{string}}</code></pre>
252+
253+
{{/ifCond}}
254+
255+
{{/each}}
256+
257+
</section>
252258

253259
<section class="code">
254260

@@ -262,11 +268,11 @@ pre .hljs {
262268

263269
{{#each tags}}
264270

265-
{{#ifCond type "return"}}
271+
{{#ifCondMatch type "return"}}
266272

267273
<p>{{#each types}}<code>{{.}}</code> {{/each}} {{{description}}}</p>
268274

269-
{{/ifCond}}
275+
{{/ifCondMatch}}
270276

271277
{{/each}}
272278

templates/markdown.hbs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,19 @@
4040

4141
{{/if}}
4242

43-
{{#if description.body}}
44-
4543
###Examples
4644

4745
{{{description.body}}}
4846

49-
{{/if}}
47+
{{#each tags}}{{#ifCond type "example"}}```
48+
{{{string}}}
49+
```{{/ifCond}}{{/each}}
50+
51+
###Returns
52+
53+
{{#each tags}}{{#ifCondMatch type "return"}}
54+
{{#each types}}`{{.}}` {{/each}} {{{description}}}
55+
{{/ifCondMatch}}{{/each}}
5056

5157
{{/if}}{{/unless}}{{/each}}{{/each}}
5258

0 commit comments

Comments
 (0)