vue-docgen-cli
Version:
Generate documentation markdown files from VueJs components using the vue-docgen-api.
30 lines (27 loc) • 844 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("./utils");
const tags_1 = require("./tags");
const tmpl = function (expose, subComponent) {
let ret = '';
expose.forEach(exp => {
ret += `
${subComponent ? '#' : ''}### ${exp.name ? exp.name : ''}
> ${exp.description || ''} ${(0, utils_1.mdclean)((0, tags_1.renderTags)(exp.tags?.reduce((acc, tag) => {
acc[tag.title] = [tag];
return acc;
}, {}))) || ''}
`;
});
return ret;
};
exports.default = (expose, opt = {}) => {
if (Object.keys(expose).length === 0) {
return '';
}
return `
${opt.isSubComponent || opt.hasSubComponents ? '#' : ''}## Expose
${tmpl(expose, opt.isSubComponent || opt.hasSubComponents || false)}
`;
};
//# sourceMappingURL=expose.js.map
;