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 cc2e56f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,10 @@ 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)

* macro `@{...}` to mention user by name specified in the braces.

## Template & Macros Usecases
Expand Down
9 changes: 9 additions & 0 deletions pkg/mark/stdlib/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,15 @@ 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:structured-macro>`,
),

// TODO(seletskiy): more templates here
} {
Expand Down

0 comments on commit cc2e56f

Please sign in to comment.