From 3307f329d98cd8d54958f87694927e4c5b46b2f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Wed, 24 May 2023 19:11:12 +0200 Subject: [PATCH] Add contentbylabel macro --- README.md | 3 +++ pkg/mark/stdlib/stdlib.go | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 9b1d5c65..1fc6dacf 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/pkg/mark/stdlib/stdlib.go b/pkg/mark/stdlib/stdlib.go index a4304ddd..4129ee8f 100644 --- a/pkg/mark/stdlib/stdlib.go +++ b/pkg/mark/stdlib/stdlib.go @@ -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( + ``, + `{{ .CQL }}`, + ``, + ), + // TODO(seletskiy): more templates here } { templates, err = templates.New(name).Parse(body)