Skip to content

Commit fd784e6

Browse files
author
Christoph Hermann
committed
render the dependencies
1 parent 2bd1216 commit fd784e6

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

.doxie.render.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function escapeStr(str) {
77
var render = function(data) {
88
var data = data.data;
99

10-
return [
10+
var doc = [
1111
'## ' + data.title,
1212
'',
1313
data.description,
@@ -17,8 +17,18 @@ var render = function(data) {
1717
' "' + data.key + '": "' + escapeStr(data.script) + '"',
1818
'}',
1919
'```',
20+
'\n',
21+
];
22+
23+
if (data.dependencies.length > 0) {
24+
25+
doc = doc.concat([
26+
'Install the dependencies `npm i ' + data.dependencies.join(' ') + ' --save-dev`',
2027
'\n'
21-
].join('\n');
28+
]);
29+
}
30+
31+
return doc.join('\n');
2232
};
2333

2434
module.exports = render;

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ Bower install before npm
6969
}
7070
```
7171

72+
73+
Install the dependencies `npm i bower --save-dev`
74+
7275
## gh-pages
7376

7477
Pushs a folder (f.e. `docs`) to the `gh-pages` branch.
@@ -81,23 +84,29 @@ Pushs a folder (f.e. `docs`) to the `gh-pages` branch.
8184

8285
## develop
8386

84-
Watch JS files and run `npm test` on every change. Remember to `npm install --save-dev nodangel` before using this.
87+
Watch JS files and run `npm test` on every change. Remember to install the dependencies before using this.
8588

8689
```json
8790
"scripts": {
8891
"develop": "nodangel --ignore node_modules --ignore coverage --exec 'npm run --silent test'"
8992
}
9093
```
9194

95+
96+
Install the dependencies `npm i nodangel --save-dev`
97+
9298
## diffy-package
9399

94-
Make the package.json more diff-friendly. Remember to `npm install --save-dev format-json sponge` before adding this script. Add `"postversion": "npm run diffy-package"` as well to auto-format the package file after a version bump. Add `"postinstall": "npm run diffy-package"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`.
100+
Make the package.json more diff-friendly. Remember to install the dependencies before adding this script. Add `"postversion": "npm run diffy-package"` as well to auto-format the package file after a version bump. Add `"postinstall": "npm run diffy-package"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`.
95101

96102
```json
97103
"scripts": {
98104
"diffy-package": "format-json package.json | sponge package.json"
99105
}
100106
```
101107

108+
109+
Install the dependencies `npm i format-json sponge --save-dev`
110+
102111
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
103112
<!-- @doxie.inject end -->

scripts.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"dependencies": []
7474
}, {
7575
"title": "develop",
76-
"description": "Watch JS files and run `npm test` on every change. Remember to `npm install --save-dev nodangel` before using this.",
76+
"description": "Watch JS files and run `npm test` on every change. Remember to install the dependencies before using this.",
7777
"key": "develop",
7878
"script": "nodangel --ignore node_modules --ignore coverage --exec 'npm run --silent test'",
7979
"keywords": [
@@ -85,7 +85,7 @@
8585
]
8686
}, {
8787
"title": "diffy-package",
88-
"description": "Make the package.json more diff-friendly. Remember to `npm install --save-dev format-json sponge` before adding this script. Add `\"postversion\": \"npm run diffy-package\"` as well to auto-format the package file after a version bump. Add `\"postinstall\": \"npm run diffy-package\"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`.",
88+
"description": "Make the package.json more diff-friendly. Remember to install the dependencies before adding this script. Add `\"postversion\": \"npm run diffy-package\"` as well to auto-format the package file after a version bump. Add `\"postinstall\": \"npm run diffy-package\"` if you’re not writing a library – your package file will be reformatted every time you run `npm install --save`.",
8989
"key": "diffy-package",
9090
"script": "format-json package.json | sponge package.json",
9191
"keywords": [

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy