Skip to content

Commit

Permalink
Add contentbylabel macro
Browse files Browse the repository at this point in the history
  • Loading branch information
mrueg committed May 25, 2023
1 parent dbb5237 commit 3307f32
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions pkg/mark/stdlib/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3307f32

Please sign in to comment.