awesome-cordova-plugins/scripts/docs/dgeni/processors/npm-id.js
2020-05-16 14:40:49 +02:00

21 lines
527 B
JavaScript

'use strict';
module.exports = function npmId(renderDocsProcessor) {
return {
name: 'npm-id',
$runAfter: ['paths-computed'],
$runBefore: ['rendering-docs'],
$process: docs => {
// pretty up and sort the docs object for menu generation
docs = docs.filter(function (doc) {
return (!!doc.name && !!doc.outputPath) || doc.docType === 'index-page';
});
docs.forEach(doc => {
doc.npmId = doc.id.match(/plugins\/(.*)\/index/)[1];
});
return docs;
},
};
};