stdlib: Add multimedia macro

This commit is contained in:
Manuel Rüger 2024-09-09 20:31:32 +02:00
parent 63ebfb853c
commit 1e91fe184f
2 changed files with 15 additions and 0 deletions

View File

@ -477,6 +477,11 @@ By default, mark provides several built-in templates and macros:
* Width: Width of the column * Width: Width of the column
* Body: The content 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. * macro `@{...}` to mention user by name specified in the braces.
## Template & Macros Usecases ## Template & Macros Usecases

View File

@ -435,6 +435,16 @@ func templates(api *confluence.API) (*template.Template, error) {
`<ac:rich-text-body>{{ or .Body "" }}</ac:rich-text-body>`, `<ac:rich-text-body>{{ or .Body "" }}</ac:rich-text-body>`,
`</ac:structured-macro>`, `</ac:structured-macro>`,
), ),
/* https://confluence.atlassian.com/conf59/multimedia-macro-792499140.html */
`ac:multimedia`: text(
`<ac:structured-macro ac:name="multimedia">`,
`<ac:parameter ac:name="width">{{ or .Width 500 }}</ac:parameter>`,
`<ac:parameter ac:name="name">`,
`<ri:attachment ri:filename="{{ .Name }}/>`,
`</ac:parameter>`,
`<ac:parameter ac:name="autoplay">{{ .AutoPlay "false"}}</ac:parameter>`,
`</ac:structured-macro>`,
),
// TODO(seletskiy): more templates here // TODO(seletskiy): more templates here
} { } {