From fe3e31d580c1a3e44a91c381613e1fbee2daf69e Mon Sep 17 00:00:00 2001 From: Ibby Date: Mon, 20 Mar 2017 20:14:51 -0400 Subject: [PATCH] chore(): display package name correctly in docs --- scripts/docs/processors/npm-id.js | 7 ++++--- scripts/docs/templates/common.template.html | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/docs/processors/npm-id.js b/scripts/docs/processors/npm-id.js index 259c19d58..3097e4433 100644 --- a/scripts/docs/processors/npm-id.js +++ b/scripts/docs/processors/npm-id.js @@ -12,9 +12,10 @@ module.exports = function npmId(renderDocsProcessor) { }); docs.forEach(function(doc, i) { - doc.npmId = doc.outputPath.replace('/README.md', '') - .replace('src/@ionic-native/plugins/','') - .replace('@ionic-native/plugins/',''); + doc.npmId = doc.outputPath.replace('/README.md', '') // for readmes + .replace('@ionic-native/plugins/','') // for readmes + .replace('content/docs/v2/native/', '') // for docs + .replace('/index.md', ''); // for docs }); // returning docs will replace docs object in the next process diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index 2277721b2..79dd0b4a4 100644 --- a/scripts/docs/templates/common.template.html +++ b/scripts/docs/templates/common.template.html @@ -225,7 +225,7 @@ docType: "<$ doc.docType $>" <@ endif @>
$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif @>
-$ npm install --save @ionic-native/<$ prop.npmId $>
+$ npm install --save @ionic-native/<$ doc.npmId $>
 

Repo: