Add expand macro

This commit is contained in:
Manuel Rüger 2023-05-22 17:22:32 +02:00
parent 484f988f32
commit 08281712cc
2 changed files with 13 additions and 0 deletions

View File

@ -417,6 +417,10 @@ By default, mark provides several built-in templates and macros:
* template: `ac:anchor` to set an anchor inside a page
- Anchor: Text for the anchor
+ template: `ac:expand` to display an expandable/collapsible section of text on your page
- Title: Defines the text next to the expand/collapse icon.
- Body: The Text that it is expanded to.
* macro `@{...}` to mention user by name specified in the braces.
## Template & Macros Usecases

View File

@ -310,6 +310,15 @@ func templates(api *confluence.API) (*template.Template, error) {
`</ac:structured-macro>{{printf "\n"}}`,
),
/* https://confluence.atlassian.com/conf59/expand-macro-792499106.html */
`ac:expand`: text(
`<ac:structured-macro ac:name="expand">{{printf "\n"}}`,
`<ac:parameter ac:name="title">{{ .Title }}</ac:parameter>{{printf "\n"}}`,
`<ac:rich-text-body>{{ .Body }}</ac:rich-text-body>{{printf "\n"}}`,
`</ac:structured-macro>`,
),
// TODO(seletskiy): more templates here
} {
templates, err = templates.New(name).Parse(body)