awesome-cordova-plugins/scripts/docs/dgeni/processors/npm-id.js

21 lines
531 B
JavaScript
Raw Normal View History

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