Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(res => {
// res is an array of parsed comments with inferred properties
// and more: everything you need to build documentation or
// any other kind of code data.
let processed = res;
if (outputPath.includes('actions.md')) {
// add action type and updater links to action
processed = res.map(node => _appendActionTypesAndUpdatersToActions(node, actionMap));
} else if (inputPath.some(p => p.includes('reducers'))) {
// add action type and updater links to action
processed = res.map(node => _appendActionToUpdaters(node, actionMap));
}
return documentation.formats.remark(processed, OUT_CONFIG)
})
.then(output => {
], {}, function (err, res) {
if (err) {
console.error(err)
process.exit()
}
documentation.formats.html(res, {}, function (err, output) {
if (err) {
console.error(err)
process.exit()
}
if (!output) {
console.error('no output generated, exiting')
process.exit()
}
streamArray(output).pipe(vfs.dest(path.resolve(__dirname, '../docs')))
})
})
new Promise(async resolve => {
const pathFile = path.resolve(
'../packages/',
node.value.split('"')[1]
);
await docs
.build([pathFile], {shallow: true})
.then(docs.formats.json)
.then(output => {
const json = JSON.parse(output);
const documentation = evaluateInstance(
json[0].members.instance
);
node.value = `<div class="table-responsive">
<table class="table table-autofit">
<thead>
<tr>
<th>Property</th>
<th>Description</th>
<th>Type</th>
<th>Required</th>
<th>Default</th>
</tr></thead></table></div>
},
{
type: 'tableCell',
children: [{
type: 'text',
value: notes[key.name] || ''
}]
}
]
}))]
})
}
}
}
const markdown = await documentation.formats.md(docs, { markdownToc: true })
fs.writeFileSync(path.join(process.cwd(), 'API.md'), markdown)
process.exit()
}
.then(comments => documentation.formats.html(comments, {}))
.then(output => {
documentation.build(['src/' + fileName + '.js'], {}, function(err, res) {
if (err) throw err;
documentation.formats.md(res, {}, function(err, output) {
if (err) throw err;
fs.writeFileSync('./docs/api/' + fileName + '.md', output);
});
});
});
files.forEach(file => {
documentation
.build([file], {shallow: true})
.then(documentation.formats.md)
.then(output => handleOutput(output, file))
})
}
.then((comments) => documentation.formats.md(comments, {
markdownToc: true
}))
.then(output => {
function documentationLoader() {
return documentation
.build([this.resourcePath], {})
.then(documentation.formats.json)
.then(output => `module.exports = ${output};`);
}
function format(docs) {
return documentation.formats.md(docs, {});
}