mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
feat: youtube widget macro (#127)
This commit is contained in:
parent
e635d1f945
commit
3797116d97
@ -197,6 +197,13 @@ By default, mark provides several built-in templates and macros:
|
|||||||
|
|
||||||
See: https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html
|
See: https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html
|
||||||
|
|
||||||
|
* template: `ac:youtube` to include YouTube Widget. Parameters:
|
||||||
|
- URL: YouTube video endpoint
|
||||||
|
- Width: Width in px. Defualts to "640px"
|
||||||
|
- Height: Height in px. Defualts to "360px"
|
||||||
|
|
||||||
|
See: https://confluence.atlassian.com/doc/widget-connector-macro-171180449.html#WidgetConnectorMacro-YouTube
|
||||||
|
|
||||||
* 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
|
||||||
|
@ -177,6 +177,18 @@ func templates(api *confluence.API) (*template.Template, error) {
|
|||||||
`<ac:emoticon ac:name="{{ .Name }}"/>`,
|
`<ac:emoticon ac:name="{{ .Name }}"/>`,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
/* https://confluence.atlassian.com/doc/widget-connector-macro-171180449.html#WidgetConnectorMacro-YouTube */
|
||||||
|
|
||||||
|
`ac:youtube`: text(
|
||||||
|
`<ac:structured-macro ac:name="widget">{{printf "\n"}}`,
|
||||||
|
`<ac:parameter ac:name="overlay">youtube</ac:parameter>{{printf "\n"}}`,
|
||||||
|
`<ac:parameter ac:name="_template">com/atlassian/confluence/extra/widgetconnector/templates/youtube.vm</ac:parameter>{{printf "\n"}}`,
|
||||||
|
`<ac:parameter ac:name="width">{{ or .Width "640px" }}</ac:parameter>{{printf "\n"}}`,
|
||||||
|
`<ac:parameter ac:name="height">{{ or .Height "360px" }}</ac:parameter>{{printf "\n"}}`,
|
||||||
|
`<ac:parameter ac:name="url"><ri:url ri:value="{{ .URL }}" /></ac:parameter>{{printf "\n"}}`,
|
||||||
|
`</ac:structured-macro>{{printf "\n"}}`,
|
||||||
|
),
|
||||||
|
|
||||||
// TODO(seletskiy): more templates here
|
// TODO(seletskiy): more templates here
|
||||||
} {
|
} {
|
||||||
templates, err = templates.New(name).Parse(body)
|
templates, err = templates.New(name).Parse(body)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user