Skip to content

Commit

Permalink
feat: makes adoc template collapsible
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszmajsak committed Feb 21, 2020
1 parent 390847f commit c011d79
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pkg/cmd/generate/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func Contains(s []string, e string) bool {
const Default = `
{{- with $prs := (withLabel .PullRequests "kind/enhancement") -}}
{{ if $prs }}
## All changes in this release
### New features
{{range $pr := $prs }}
* {{$pr.Title}} ([#{{$pr.Number}}]({{$pr.Permalink}})), by [@{{$pr.Author}}](https://github.com/{{$pr.Author}})
Expand Down Expand Up @@ -66,7 +67,10 @@ const Default = `
const DefaultAdoc = `
{{- with $prs := (withLabel .PullRequests "kind/enhancement") -}}
{{ if $prs }}
=== New features
.All changes in this release
[%collapsible]
====
*New features*
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{- end -}}
Expand All @@ -75,7 +79,7 @@ const DefaultAdoc = `
{{- with $prs := (withLabel .PullRequests "kind/bug") -}}
{{ if $prs }}
=== Bug fixes
*Bug fixes*
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{- end -}}
Expand All @@ -84,7 +88,7 @@ const DefaultAdoc = `
{{- with $prs := (withLabel .PullRequests "dependencies") -}}
{{ if $prs }}
=== Latest dependencies update
*Latest dependencies update*
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}])
{{- end -}}
Expand All @@ -93,7 +97,7 @@ const DefaultAdoc = `
{{- with $prs := (withLabel .PullRequests "internal/infra") -}}
{{ if $prs }}
=== Project infrastructure
*Project infrastructure*
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{- end -}}
Expand All @@ -102,10 +106,11 @@ const DefaultAdoc = `
{{- with $prs := (withLabel .PullRequests "internal/test-infra") -}}
{{ if $prs }}
=== Testing
*Testing*
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{- end -}}
{{ end }}
====
{{ end }}
`

0 comments on commit c011d79

Please sign in to comment.