Skip to content

Commit d4979b7

Browse files
committed
Methods now generated into separate files.
1 parent 4ec11d1 commit d4979b7

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

lib/utils.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,23 @@ module.exports.buildDashDocSet = function (input) {
1717

1818
input.uid = module.exports.formatStringForUID(input.title);
1919

20-
zip.addFile(
21-
input.title + '.docset/Contents/Resources/Documents/index.html',
22-
require('../templates/dash/index.hbs')(input)
23-
);
20+
input.files.forEach(function (file) {
21+
22+
file.methods.forEach(function (method) {
23+
24+
if (!method.ignore && method.ctx) {
25+
26+
zip.addFile(
27+
input.title + '.docset/Contents/Resources/Documents/' + method.ctx.uid + '.html',
28+
require('../templates/dash/index.hbs')(method)
29+
);
30+
31+
}
32+
33+
});
34+
35+
});
36+
2437

2538
zip.addFile(
2639
input.title + '.docset/Contents/Info.plist',
@@ -53,7 +66,7 @@ module.exports.buildDashDocSet = function (input) {
5366
db.run('INSERT OR IGNORE INTO searchIndex(name, type, path) VALUES ($name, $type, $path);', {
5467
$name: hbs.helpers.formatName(method.ctx.string),
5568
$type: method.ctx.type.replace(/^[a-z]/, function (match) { return match.toUpperCase(); }),
56-
$path: 'index.html#' + method.ctx.uid
69+
$path: method.ctx.uid + '.html'
5770
});
5871

5972
}

templates/dash/index.hbs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ pre .hljs {
3636

3737
<div class="wrap">
3838

39-
<h1>{{title}}{{#if description}} <small>{{description}}</small>{{/if}}</h1>
40-
41-
{{#each files}}
42-
43-
{{#each methods}}
44-
4539
{{#unless ignore}}
4640

4741
{{#if ctx}}
@@ -161,10 +155,6 @@ pre .hljs {
161155

162156
{{/unless}}
163157

164-
{{/each}}
165-
166-
{{/each}}
167-
168158
</div>
169159

170160
<footer class="bs-footer">

0 commit comments

Comments
 (0)