Skip to content

Commit

Permalink
fix: aligns section headers for better readability in the generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszmajsak committed Mar 4, 2021
1 parent 5ad6ea1 commit 7964493
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pkg/cmd/generate/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,19 @@ func Contains(s []string, es ...string) bool {
}

const ChangeSection = `{{- if .PullRequests -}}
#### {{ .Title }}
##### {{ .Title }}
{{range $pr := .PullRequests -}}
* {{$pr.Title}} ([#{{$pr.Number}}]({{$pr.Permalink}})), by [@{{$pr.Author}}](https://github.com/{{$pr.Author}})
{{ end -}}
{{- end -}}`

const ChangeSectionAdoc = `{{- if .PullRequests -}}
==== {{ .Title }}
{{range $pr := .PullRequests -}}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{ end -}}
{{- end -}}`

const Default = `
{{- range $areaName, $areaLabel := .Areas -}}
{{- $bugs := (withLabels $.PullRequests "kind/bug" $areaLabel) -}}
{{- $features := (withLabels $.PullRequests "kind/enhancement" $areaLabel) -}}
{{- if or $bugs $features -}}
### {{ $areaName }}
#### {{ $areaName }}
{{ template "section" (combine $features "New features") }}
{{ template "section" (combine $bugs "Bugs") }}
Expand All @@ -77,21 +70,28 @@ const Default = `
{{- with $prs := (withLabels .PullRequests "dependencies") -}}
{{- if $prs -}}
## Latest dependencies update
### Latest dependencies update
{{range $pr := $prs }}
* {{$pr.Title}} ([#{{$pr.Number}}]({{$pr.Permalink}}))
{{- end -}}
{{- end -}}
{{- end }}
`

const ChangeSectionAdoc = `{{- if .PullRequests -}}
===== {{ .Title }}
{{range $pr := .PullRequests -}}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{ end -}}
{{- end -}}`

const DefaultAdoc = `
{{- range $areaName, $areaLabel := .Areas -}}
{{- $bugs := (withLabels $.PullRequests "kind/bug" $areaLabel) -}}
{{- $features := (withLabels $.PullRequests "kind/enhancement" $areaLabel) -}}
{{- if or $bugs $features -}}
=== {{ $areaName }}
==== {{ $areaName }}
{{ template "section" (combine $features "New features") }}
{{ template "section" (combine $bugs "Bugs") }}
Expand All @@ -100,7 +100,7 @@ const DefaultAdoc = `
{{- with $prs := (withLabels .PullRequests "dependencies") -}}
{{- if $prs -}}
== Latest dependencies update
=== Latest dependencies update
{{range $pr := $prs }}
* {{$pr.Title}} ({{$pr.Permalink}}[#{{$pr.Number}}]), by https://github.com/{{$pr.Author}}[@{{$pr.Author}}]
{{- end -}}
Expand Down

0 comments on commit 7964493

Please sign in to comment.