Skip to content

Commit

Permalink
initial commit for create the readme from a json
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Hermann committed Jul 5, 2015
1 parent d31dec1 commit 31d1523
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 10 deletions.
18 changes: 18 additions & 0 deletions .doxie.render.js
@@ -0,0 +1,18 @@
var render = function(data) {
var data = data.data;

return [
'## ' + data.title,
'',
data.description,
'',
'```js',
'"scripts": {',
' "' + data.key + ': "' + data.script + '"',
'}',
'```',
'\n'
].join('\n');
};

module.exports = render;
43 changes: 35 additions & 8 deletions README.md
@@ -1,21 +1,45 @@
# Collection of useful npm-scripts!

## Release
<!-- @doxie.inject start -->
<!-- Don’t remove or change the comment above – that can break automatic updates. -->
## minor-release

Publish a minor release of a package

```js
"scripts": {
"minor-release: "npm version patch && npm publish && git push --follow-tags"
}
```
## patch-release
Publish a patch release of a package
```js
"scripts": {
"patch-release: "npm version patch && npm publish && git push --follow-tags"
}
```

## major-release

Publish a major release of a package

```js
"scripts": {
"minor-release": "npm version patch && npm publish && git push --follow-tags",
"patch-release": "npm version patch && npm publish && git push --follow-tags",
"major-release": "npm version major && npm publish && git push --follow-tags"
"major-release: "npm version major && npm publish && git push --follow-tags"
}
```
## Bower install before npm
## Bower postinstall
Bower install before npm
```js
"scripts": {
"postinstall": "bower install"
}
"postinstall: "bower install"
}
```

## gh-pages
Expand All @@ -24,6 +48,9 @@ Pushs a folder (f.e. `docs`) to the `gh-pages` branch.

```js
"scripts": {
"update-gh-pages": "git push origin `git subtree split --prefix docs master`:gh-pages --force"
"update-gh-pages: "git push origin `git subtree split --prefix docs master`:gh-pages --force"
}
```
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->
8 changes: 6 additions & 2 deletions package.json
Expand Up @@ -4,7 +4,8 @@
"description": "collection of npm scripts",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"create-readme": "doxie --render --output < ./scripts.json --inject into README.md"
},
"repository": {
"type": "git",
Expand All @@ -24,6 +25,9 @@
},
"homepage": "https://github.com/npm-scripts/scripts#readme",
"devDependencies": {
"doxie": "^0.2.2"
"doxie": "^0.2.2",
"doxie.inject": "^0.1.1",
"doxie.output": "^0.3.0",
"doxie.render": "^0.3.0"
}
}

0 comments on commit 31d1523

Please sign in to comment.