Add contentbylabel macro

This commit is contained in:
Manuel Rüger 2023-05-24 19:11:12 +02:00
parent dbb5237338
commit 3307f329d9
2 changed files with 11 additions and 0 deletions

View File

@ -424,6 +424,9 @@ By default, mark provides several built-in templates and macros:
* template: `ac:profile` to display a short summary of a given Confluence user's profile.
- Name: The username of the Confluence user whose profile summary you wish to show.
* template: `ac:contentbylabel` to display a list of pages, blog posts or attachments that have particular labels
- CQL: The CQL query to discover the content
* macro `@{...}` to mention user by name specified in the braces.
## Template & Macros Usecases

View File

@ -339,6 +339,14 @@ func templates(api *confluence.API) (*template.Template, error) {
`{{ end }}`,
),
/* https://confluence.atlassian.com/conf59/content-by-label-macro-792499087.html */
`ac:contentbylabel`: text(
`<ac:structured-macro ac:name="contentbylabel" ac:schema-version="3">`,
`<ac:parameter ac:name="cql">{{ .CQL }}</ac:parameter>`,
`</ac:structured-macro>`,
),
// TODO(seletskiy): more templates here
} {
templates, err = templates.New(name).Parse(body)