diff --git a/README.md b/README.md index 206fc0e..fe41f30 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/pkg/mark/stdlib/stdlib.go b/pkg/mark/stdlib/stdlib.go index 427f251..3a1cb2a 100644 --- a/pkg/mark/stdlib/stdlib.go +++ b/pkg/mark/stdlib/stdlib.go @@ -310,6 +310,15 @@ func templates(api *confluence.API) (*template.Template, error) { `{{printf "\n"}}`, ), + /* https://confluence.atlassian.com/conf59/expand-macro-792499106.html */ + + `ac:expand`: text( + `{{printf "\n"}}`, + `{{ .Title }}{{printf "\n"}}`, + `{{ .Body }}{{printf "\n"}}`, + ``, + ), + // TODO(seletskiy): more templates here } { templates, err = templates.New(name).Parse(body)