From 1e91fe184f359e4d36d58771e975052fdccdb6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Mon, 9 Sep 2024 20:31:32 +0200 Subject: [PATCH] stdlib: Add multimedia macro --- README.md | 5 +++++ pkg/mark/stdlib/stdlib.go | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/README.md b/README.md index ba7443d..24d9b36 100644 --- a/README.md +++ b/README.md @@ -477,6 +477,11 @@ By default, mark provides several built-in templates and macros: * Width: Width of the column * Body: The content of the column +* template: `ac:multimedia` to embedd an attached video, animation or other multimedia files in a Confluence page + * Name: Name of the file + * Width: Width of the video (optional) + * AutoPlay: Start playing the file on page load (default: false) + * 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 5a10ed4..069a059 100644 --- a/pkg/mark/stdlib/stdlib.go +++ b/pkg/mark/stdlib/stdlib.go @@ -435,6 +435,16 @@ func templates(api *confluence.API) (*template.Template, error) { `{{ or .Body "" }}`, ``, ), + /* https://confluence.atlassian.com/conf59/multimedia-macro-792499140.html */ + `ac:multimedia`: text( + ``, + `{{ or .Width 500 }}`, + ``, + `{{ .AutoPlay "false"}}`, + ``, + ), // TODO(seletskiy): more templates here } {