mirror of
https://github.com/kovetskiy/mark.git
synced 2025-06-08 23:42:40 +08:00
feat: add iframe support (#143)
* feat: add iframe support * add comment
This commit is contained in:
parent
ac8133a8b9
commit
08f37fe2b9
17
README.md
17
README.md
@ -235,6 +235,23 @@ By default, mark provides several built-in templates and macros:
|
|||||||
|
|
||||||
See: https://confluence.atlassian.com/doc/children-display-macro-139501.html
|
See: https://confluence.atlassian.com/doc/children-display-macro-139501.html
|
||||||
|
|
||||||
|
* template: `ac:iframe` to include iframe macro (cloud only)
|
||||||
|
- URL: URL to the iframe.
|
||||||
|
- Frameborder: Choose whether to draw a border around content in the iframe.
|
||||||
|
- `show` (Default)
|
||||||
|
- `hide`
|
||||||
|
- Width: Width in px. Defualts to "640px"
|
||||||
|
- Height: Height in px. Defualts to "360px"
|
||||||
|
- Scrolling: Allow or prevent scrolling in the iframe to see additional content.
|
||||||
|
- `yes`
|
||||||
|
- `no`
|
||||||
|
- `auto` (Default)
|
||||||
|
- Align: Align the iframe to the left or right of the page.
|
||||||
|
- `left` (Default)
|
||||||
|
- `right`
|
||||||
|
|
||||||
|
See: https://support.atlassian.com/confluence-cloud/docs/insert-the-iframe-macro
|
||||||
|
|
||||||
* 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
|
||||||
|
@ -210,6 +210,19 @@ func templates(api *confluence.API) (*template.Template, error) {
|
|||||||
`</ac:structured-macro>{{printf "\n"}}`,
|
`</ac:structured-macro>{{printf "\n"}}`,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
/* https://support.atlassian.com/confluence-cloud/docs/insert-the-iframe-macro/ */
|
||||||
|
|
||||||
|
`ac:iframe`: text(
|
||||||
|
`<ac:structured-macro ac:name="iframe">{{printf "\n"}}`,
|
||||||
|
`<ac:parameter ac:name="src"><ri:url ri:value="{{ .URL }}" /></ac:parameter>{{printf "\n"}}`,
|
||||||
|
`{{ if .Frameborder}}<ac:parameter ac:name="frameborder">{{ .Frameborder }}</ac:parameter>{{printf "\n"}}{{end}}`,
|
||||||
|
`{{ if .Scrolling}}<ac:parameter ac:name="id">{{ .Scrolling }}</ac:parameter>{{printf "\n"}}{{end}}`,
|
||||||
|
`{{ if .Align}}<ac:parameter ac:name="align">{{ .Align }}</ac:parameter>{{printf "\n"}}{{end}}`,
|
||||||
|
`<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: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