Skip to content

Commit

Permalink
stdlib: Add multimedia macro
Browse files Browse the repository at this point in the history
  • Loading branch information
mrueg committed Sep 9, 2024
1 parent 63ebfb8 commit 1e91fe1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions pkg/mark/stdlib/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,16 @@ func templates(api *confluence.API) (*template.Template, error) {
`<ac:rich-text-body>{{ or .Body "" }}</ac:rich-text-body>`,
`</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
} {
Expand Down

0 comments on commit 1e91fe1

Please sign in to comment.