Skip to content

Commit

Permalink
feat: introduces adoc template
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszmajsak committed Dec 5, 2019
1 parent 69c11ce commit cc29381
Showing 1 changed file with 63 additions and 7 deletions.
70 changes: 63 additions & 7 deletions pkg/cmd/generate/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,99 @@ type Changelog struct {
}

const Default = `
# Highlights of {{.Release }} release
## New features
### New features
{{- with $prs := (index .PullRequests "enhancement") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ([#{{$pr.Number}}]({{$pr.Permalink}})), by [@{{$pr.Author}}](https://github.com/{{$pr.Author}})
{{- end -}}
{{ end }}
## Bug fixes
### Bug fixes
{{- with $prs := (index .PullRequests "bug") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ([#{{$pr.Number}}]({{$pr.Permalink}})), by [@{{$pr.Author}}](https://github.com/{{$pr.Author}})
{{- end -}}
{{ end }}
## Dependencies update
### Dependencies update
{{- with $prs := (index .PullRequests "dependencies") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ([#{{$pr.Number}}]({{$pr.Permalink}}))
{{- end -}}
{{ end }}
## Project infrastructure
### Project infrastructure
{{- with $prs := (index .PullRequests "infra") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ([#{{$pr.Number}}]({{$pr.Permalink}})), by [@{{$pr.Author}}](https://github.com/{{$pr.Author}})
{{- end -}}
{{ end }}
## Testing
### Testing
{{- with $prs := (index .PullRequests "test-infra") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ([#{{$pr.Number}}]({{$pr.Permalink}})), by [@{{$pr.Author}}](https://github.com/{{$pr.Author}})
{{- end -}}
{{ end }}
### Misc
{{- with $prs := (index .PullRequests "uncategorized") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ([#{{$pr.Number}}]({{$pr.Permalink}})), by [@{{$pr.Author}}](https://github.com/{{$pr.Author}})
{{- end -}}
{{ end }}
`

const DefaultAdoc = `
=== New features
{{- with $prs := (index .PullRequests "enhancement") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{- end -}}
{{ end }}
=== Bug fixes
{{- with $prs := (index .PullRequests "bug") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{- end -}}
{{ end }}
=== Dependencies update
{{- with $prs := (index .PullRequests "dependencies") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}])
{{- end -}}
{{ end }}
=== Project infrastructure
{{- with $prs := (index .PullRequests "infra") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{- end -}}
{{ end }}
=== Testing
{{- with $prs := (index .PullRequests "test-infra") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{- end -}}
{{ end }}
=== Misc
{{- with $prs := (index .PullRequests "uncategorized") -}}
{{range $pr := $prs }}
* {{$pr.Title}} ([#{{$pr.Number}}]({{$pr.Permalink}})), by [@{{$pr.Author}}](https://github.com/{{$pr.Author}})
{{- end -}}
Expand Down

0 comments on commit cc29381

Please sign in to comment.