Skip to content

Commit

Permalink
Removed Debug Logs, Added Changelogs and Uses mdsquash its self
Browse files Browse the repository at this point in the history
  • Loading branch information
Phara0h committed Aug 3, 2020
1 parent c219f35 commit b9f4c03
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 20 deletions.
21 changes: 21 additions & 0 deletions ExampleUse.md
@@ -0,0 +1,21 @@
```sh
mdsquash -i /some/mdfile.md,/another/mdfile.md
```

This example expects two MD files as the input.
## Example Readme.nbs

```md

# Test

## Something

{{doc1}}


## Foo

{{doc2}}

```
22 changes: 5 additions & 17 deletions README.md → Readme.nbs
Expand Up @@ -22,25 +22,13 @@ Options:

## Example Use


```sh
mdsquash -i /some/mdfile.md,/another/mdfile.md
```

This example expects two MD files as the input.
## Example Readme.nbs

```md

# Test

## Something

{{doc1}}


## Foo
## Changelog

{{doc2}}

```

## License

{{doc3}}
30 changes: 30 additions & 0 deletions changelog-template.hbs
@@ -0,0 +1,30 @@
### Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

{{#each releases}}
{{#if href}}
###{{#unless major}}#{{/unless}} [{{title}}]({{href}})
{{else}}
#### {{title}}
{{/if}}

{{#if tag}}
> {{niceDate}}
{{/if}}

{{#if summary}}
{{summary}}
{{/if}}

{{#each merges}}
- {{{message}}}{{#if href}} [`#{{id}}`]({{href}}){{/if}}
{{/each}}
{{#each fixes}}
- {{{commit.subject}}}{{#each fixes}}{{#if href}} [`#{{id}}`]({{href}}){{/if}}{{/each}}
{{/each}}
{{#each commits}}
- {{#if breaking}}**Breaking change:** {{/if}}{{{subject}}}{{#if href}} [`{{shorthash}}`]({{href}}){{/if}}
{{/each}}

{{/each}}
2 changes: 0 additions & 2 deletions index.js
Expand Up @@ -45,9 +45,7 @@ async function start() {
for (var i = 0; i < program.input.length; i++) {
mdFiles[`doc${i+1}`] = await fs.readFile(program.input[i], {encoding: 'ascii'});
}
console.log(mdFiles)
var merged = template(mdFiles);
console.log(merged)
await fs.writeFile(program.out,merged, {encoding: 'ascii'});

console.log('Done');
Expand Down
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -4,7 +4,9 @@
"description": "Merges multiple MD files into one readme",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"version": "auto-changelog -l false --template changelog-template.hbs -p && ./index.js -i ExampleUse.md,CHANGELOG.md,LICENSE && git add -A CHANGELOG.md && git add -A README.md",
"postversion": "git push && git push --tags && npm publish"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit b9f4c03

Please sign in to comment.