feat: Add Excerpt and ExcerptInclude macros

This commit is contained in:
Manuel Rüger
2023-03-31 17:25:33 +02:00
parent 1285947ab3
commit deb7cd9cbc
2 changed files with 30 additions and 0 deletions

View File

@@ -273,6 +273,27 @@ func templates(api *confluence.API) (*template.Template, error) {
`</ac:structured-macro>{{printf "\n"}}`,
),
/* https://confluence.atlassian.com/conf59/excerpt-include-macro-792499101.html */
`ac:excerpt-include`: text(
`<ac:macro ac:name="excerpt-include">{{printf "\n"}}`,
`<ac:parameter ac:name="nopanel">{{ if .NoPanel }}{{ .NoPanel }}{{ else }}false{{ end }}</ac:parameter>{{printf "\n"}}`,
`<ac:default-parameter>{{ .Page }}</ac:default-parameter>{{printf "\n"}}`,
`</ac:macro>{{printf "\n"}}`,
),
/* https://confluence.atlassian.com/conf59/excerpt-macro-792499102.html */
`ac:excerpt`: text(
`<ac:structured-macro ac:name="excerpt">{{printf "\n"}}`,
`<ac:parameter ac:name="hidden">{{ if .Hidden }}{{ .Hidden }}{{ else }}false{{ end }}</ac:parameter>{{printf "\n"}}`,
`<ac:parameter ac:name="atlassian-macro-output-type">{{ if .OutputType }}{{ .OutputType }}{{ else }}BLOCK{{ end }}</ac:parameter>{{printf "\n"}}`,
`<ac:rich-text-body>{{printf "\n"}}`,
`{{ .Excerpt }}{{printf "\n"}}`,
`</ac:rich-text-body>{{printf "\n"}}`,
`</ac:structured-macro>{{printf "\n"}}`,
),
// TODO(seletskiy): more templates here
} {
templates, err = templates.New(name).Parse(body)