-
Notifications
You must be signed in to change notification settings - Fork 380
/
docgen.config.js
31 lines (31 loc) · 1.04 KB
/
docgen.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module.exports = {
componentsRoot: 'src/components',
components: '**/[A-Z]*.vue',
outDir: './docs/components',
defaultExamples: false,
templates: {
component: (renderedUsage, doc) => {
const { displayName, description, docsBlocks, tags, functional } = doc;
const { deprecated, author, since, version, see, link } = tags || {};
return `
---
title: ${displayName}
---
# ${deprecated ? `~~${displayName}~~` : displayName}
${deprecated ? `> **Deprecated** ${deprecated[0].description}\n` : ''}
${description ? '> ' + description : ''}
${functional ? renderedUsage.functionalTag : ''}
${author ? author.map(a => `Author: ${a.description}\n`) : ''}
${since ? `Since: ${since[0].description}\n` : ''}
${version ? `Version: ${version[0].description}\n` : ''}
${see ? see.map(s => `[See](${s.description})\n`) : ''}
${link ? link.map(l => `[See](${l.description})\n`) : ''}
${docsBlocks ? '---\n' + docsBlocks.join('\n---\n') : ''}
${renderedUsage.props}
${renderedUsage.methods}
${renderedUsage.events}
${renderedUsage.slots}
`;
},
},
};