mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
Add expand macro
This commit is contained in:
parent
484f988f32
commit
08281712cc
@ -417,6 +417,10 @@ By default, mark provides several built-in templates and macros:
|
|||||||
* template: `ac:anchor` to set an anchor inside a page
|
* template: `ac:anchor` to set an anchor inside a page
|
||||||
- Anchor: Text for the anchor
|
- Anchor: Text for the anchor
|
||||||
|
|
||||||
|
+ template: `ac:expand` to display an expandable/collapsible section of text on your page
|
||||||
|
- Title: Defines the text next to the expand/collapse icon.
|
||||||
|
- Body: The Text that it is expanded to.
|
||||||
|
|
||||||
* 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
|
||||||
|
@ -310,6 +310,15 @@ func templates(api *confluence.API) (*template.Template, error) {
|
|||||||
`</ac:structured-macro>{{printf "\n"}}`,
|
`</ac:structured-macro>{{printf "\n"}}`,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
/* https://confluence.atlassian.com/conf59/expand-macro-792499106.html */
|
||||||
|
|
||||||
|
`ac:expand`: text(
|
||||||
|
`<ac:structured-macro ac:name="expand">{{printf "\n"}}`,
|
||||||
|
`<ac:parameter ac:name="title">{{ .Title }}</ac:parameter>{{printf "\n"}}`,
|
||||||
|
`<ac:rich-text-body>{{ .Body }}</ac:rich-text-body>{{printf "\n"}}`,
|
||||||
|
`</ac:structured-macro>`,
|
||||||
|
),
|
||||||
|
|
||||||
// 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