Skip to content

Commit c64791b

Browse files
committed
Update of doc generation config
1 parent 8e9afa1 commit c64791b

21 files changed

+325
-84
lines changed

bin/docgen

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const mkpath = require('mkpath');
1212
const path = require('path');
1313
const rimraf = require('rimraf');
1414

15-
rimraf.sync(path.resolve(__dirname, '../docs/auto'));
15+
rimraf.sync(path.resolve(__dirname, '../docs'));
1616

17-
const outputDir = path.resolve(__dirname, '../docs/auto');
17+
const outputDir = path.resolve(__dirname, '../docs');
1818

1919
const data = jsdoc2md.getTemplateDataSync({ files: 'src/**/*.js' });
2020

@@ -31,3 +31,15 @@ moduleNames.forEach((name) => {
3131
mkpath.sync(path.dirname(destFile));
3232
fs.writeFileSync(destFile, output);
3333
});
34+
35+
const template = '{{>module-index}}';
36+
const output = jsdoc2md.renderSync({
37+
data,
38+
partial: [
39+
`${__dirname}/misc/module-index-dl.hbs`,
40+
`${__dirname}/misc/doc-link-html.hbs`,
41+
],
42+
template,
43+
});
44+
const dest = `${outputDir}/index.md`;
45+
fs.writeFileSync(dest, output);

bin/misc/doc-link-html.hbs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
{{#if name}}{{#sig no-gfm=true ~}}
3+
{{{@depOpen}~}}
4+
<a href="{{{name}}}.md">
5+
{{~{@codeOpen}~}}
6+
{{#if @prefix}}{{@prefix}} {{/if~}}
7+
{{@accessSymbol}}{{#if (isEvent)}}"{{{name}}}"{{else}}{{{name}}}{{/if~}}
8+
{{~#if @methodSign}}{{#if (isEvent)}} {{@methodSign}}{{else}}{{@methodSign}}{{/if}}{{/if~}}
9+
{{{@codeClose}~}}
10+
</a>
11+
{{~#if @returnSymbol}} {{@returnSymbol}}{{/if~}}
12+
{{#if @returnTypes}} {{>linked-type-list types=@returnTypes html=true delimiter=" | " }}{{/if~}}
13+
{{#if @suffix}} {{@suffix}}{{/if~}}
14+
{{{@depClose}~}}
15+
{{~/sig}}{{/if~}}

bin/misc/module-index-dl.hbs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{#modules~}}
2+
{{#if @first~}}{{>heading-indent}}Modules
3+
4+
<dl>
5+
{{/if~}}
6+
<dt>{{>doc-link-html}}</dt>
7+
<dd>{{{md (inlineLinks description)}}}</dd>
8+
{{#if @last~}}</dl>
9+
10+
{{/if~}}
11+
{{/modules~}}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy