-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for specifying templates
Also add a simple compact template
- Loading branch information
Showing
8 changed files
with
105 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Default from './templates/Default' | ||
import Compact from './templates/Compact' | ||
|
||
export default { | ||
default: Default, | ||
compact: Compact | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Simple, slimline template based on https://github.com/rackt/react-router/blob/master/CHANGES.md | ||
|
||
import Default from './Default' | ||
|
||
export default class Compact extends Default { | ||
mergesTitle = null | ||
fixesTitle = null | ||
commitsTitle = null | ||
|
||
fixPrefix = 'Fixed ' | ||
mergePrefix = 'Merged ' | ||
|
||
listSpacing = '\n' | ||
|
||
renderReleaseHeading = (release, previousRelease) => { | ||
const title = this.renderReleaseTitle(release, previousRelease) | ||
const date = release.tag ? `\n> ${formatDate(release.date)}` : '' | ||
return `### ${title}${date}\n` | ||
} | ||
} | ||
|
||
function formatDate (string) { | ||
const date = new Date(string) | ||
const day = date.getDate() | ||
const month = date.toLocaleString('en', { month: 'long' }) | ||
const year = date.getFullYear() | ||
return `${day} ${month} ${year}` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export default `# Change Log | ||
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). | ||
Generated by [auto-changelog](https://github.com/CookPete/auto-changelog) | ||
### [Unreleased](https://github.com/user/repo/compare/v0.0.2...HEAD) | ||
* Fixed [#6](https://github.com/user/repo/issues/6): Unreleased commit | ||
### [v0.0.2](https://github.com/user/repo/compare/v0.0.1...v0.0.2) | ||
> 28 December 2015 | ||
* Merged [#5](https://github.com/user/repo/pull/5): Should not parse #4 in PR title | ||
* Fixed [#4](https://github.com/user/repo/issues/4): Commit 4 fixes #4 in the subject | ||
### v0.0.1 | ||
> 15 December 2015 | ||
* Merged [#3](https://github.com/user/repo/pull/3): Pull request title | ||
* Fixed [#1](https://github.com/user/repo/issues/1), [#2](https://github.com/user/repo/issues/2): Second commit | ||
` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters