feat: format commit as markdown item
parent
063680ab31
commit
6a5d3fe235
|
@ -49,11 +49,11 @@ func (g *MarkdownGenerator) getLines(commits []convention.Commit) []string {
|
|||
t := getType(commit.Type)
|
||||
switch t {
|
||||
case addedType:
|
||||
addedLines = append(addedLines, commit.RawHeader)
|
||||
addedLines = append(addedLines, g.composeListItem(commit.RawHeader))
|
||||
case fixedType:
|
||||
fixedLines = append(fixedLines, commit.RawHeader)
|
||||
fixedLines = append(fixedLines, g.composeListItem(commit.RawHeader))
|
||||
case othersType:
|
||||
othersLines = append(othersLines, commit.RawHeader)
|
||||
othersLines = append(othersLines, g.composeListItem(commit.RawHeader))
|
||||
default:
|
||||
continue
|
||||
}
|
||||
|
@ -73,9 +73,13 @@ func (g *MarkdownGenerator) getLines(commits []convention.Commit) []string {
|
|||
|
||||
func (g *MarkdownGenerator) composeVersionHeader() string {
|
||||
year, month, day := g.t.Date()
|
||||
return fmt.Sprintf("# %s (%d-%d-%d)", g.version, year, month, day)
|
||||
return fmt.Sprintf("## %s (%d-%d-%d)", g.version, year, month, day)
|
||||
}
|
||||
|
||||
func (g *MarkdownGenerator) composeTypeHeader(t string) string {
|
||||
return fmt.Sprintf("## %s", t)
|
||||
return fmt.Sprintf("### %s", t)
|
||||
}
|
||||
|
||||
func (g *MarkdownGenerator) composeListItem(text string) string {
|
||||
return fmt.Sprintf("* %s", text)
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[
|
||||
"# CHANGELOG",
|
||||
"# v1.0.0 (1-1-1)",
|
||||
"## Added",
|
||||
"feat: description",
|
||||
"## Fixed",
|
||||
"## Others"
|
||||
"## v1.0.0 (1-1-1)",
|
||||
"### Added",
|
||||
"* feat: description",
|
||||
"### Fixed",
|
||||
"### Others"
|
||||
]
|
|
@ -1,8 +1,8 @@
|
|||
[
|
||||
"# CHANGELOG",
|
||||
"# v1.0.0 (1-1-1)",
|
||||
"## Added",
|
||||
"## Fixed",
|
||||
"fix: description",
|
||||
"## Others"
|
||||
"## v1.0.0 (1-1-1)",
|
||||
"### Added",
|
||||
"### Fixed",
|
||||
"* fix: description",
|
||||
"### Others"
|
||||
]
|
|
@ -1,8 +1,8 @@
|
|||
[
|
||||
"# CHANGELOG",
|
||||
"# v1.0.0 (1-1-1)",
|
||||
"## Added",
|
||||
"## Fixed",
|
||||
"## Others",
|
||||
"ci: description"
|
||||
"## v1.0.0 (1-1-1)",
|
||||
"### Added",
|
||||
"### Fixed",
|
||||
"### Others",
|
||||
"* ci: description"
|
||||
]
|
|
@ -1,11 +1,11 @@
|
|||
[
|
||||
"# CHANGELOG",
|
||||
"# v1.0.0 (1-1-1)",
|
||||
"## Added",
|
||||
"feat: description feat",
|
||||
"## Fixed",
|
||||
"fix: description fix",
|
||||
"## Others",
|
||||
"ci: description ci",
|
||||
"build: description build"
|
||||
"## v1.0.0 (1-1-1)",
|
||||
"### Added",
|
||||
"* feat: description feat",
|
||||
"### Fixed",
|
||||
"* fix: description fix",
|
||||
"### Others",
|
||||
"* ci: description ci",
|
||||
"* build: description build"
|
||||
]
|
Loading…
Reference in New Issue