diff --git a/templates/contracts-doc.tmpl b/templates/contracts-doc.tmpl index c99c780..78e1f00 100644 --- a/templates/contracts-doc.tmpl +++ b/templates/contracts-doc.tmpl @@ -1,9 +1,11 @@ -{{- range .Blocks -}} - {{- if eq .Kind "paragraph" -}} - {{- paragraph .Text -}} - {{- else if eq .Kind "code" -}} - {{- codeBlock "" .Text -}} - {{- else if eq .Kind "header" -}} - {{- header (add .Level 1) .Text -}} +{{- range (iter .Blocks) -}} + {{- "\n" -}} + {{- if eq .Entry.Kind "paragraph" -}} + {{- template "text" .Entry.Spans -}} + {{- else if eq .Entry.Kind "code" -}} + {{- codeBlock "" (include "text" .Entry.Spans) -}} + {{- else if eq .Entry.Kind "header" -}} + {{- header (add .Entry.Level 1) (include "text" .Entry.Spans) -}} {{- end -}} + {{- "\n" -}} {{- end -}} diff --git a/templates/contracts-func.tmpl b/templates/contracts-func.tmpl index 2bc982e..48a6a65 100644 --- a/templates/contracts-func.tmpl +++ b/templates/contracts-func.tmpl @@ -1,8 +1,7 @@ -{{- .Name | rawHeader (add .Level 3) -}} +{{.Name | rawHeader (add .Level 3)}} -{{- codeBlock "go" .Signature -}} - -{{- template "doc" .Doc -}} +{{codeBlock "go" .Signature}} +{{template "doc" .Doc -}} {{- range .Examples -}} {{- template "example" . -}} diff --git a/templates/contracts-package.tmpl b/templates/contracts-package.tmpl index 63163af..2efb712 100644 --- a/templates/contracts-package.tmpl +++ b/templates/contracts-package.tmpl @@ -1,17 +1,15 @@ -{{- if eq .Name "main" -}} - {{- header .Level .Dirname -}} -{{- else -}} - {{- .Name | printf "%s contract" | header (add .Level 2) -}} -{{- end -}} +{{if eq .Name "main"}} + {{- header .Level .Dirname}} +{{else}} + {{- .Name | printf "%s contract" | header (add .Level 2)}} +{{end}} -{{- template "doc" .Doc -}} +{{template "doc" .Doc}} {{- range .Examples -}} {{- template "example" . -}} -{{- end -}} - -{{- header (add .Level 3) "Contract methods" -}} - -{{- range .Funcs -}} - {{- template "func" . -}} +{{- end}} +{{header (add .Level 3) "Contract methods"}} +{{range .Funcs -}} + {{- "\n"}}{{template "func" .}} {{- end -}}