mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 16:52:53 +08:00
21 lines
531 B
JavaScript
21 lines
531 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;
|
|
},
|
|
};
|
|
};
|