mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
Merge pull request #278 from mrueg/add-anchor
feat: Support anchor macro
This commit is contained in:
commit
7969bcbfdd
@ -384,6 +384,9 @@ By default, mark provides several built-in templates and macros:
|
|||||||
- OutputType: Determines whether the content of the Excerpt macro body is displayed on a new line or inline (optional, options: "BLOCK" or "INLINE", default: BLOCK)
|
- OutputType: Determines whether the content of the Excerpt macro body is displayed on a new line or inline (optional, options: "BLOCK" or "INLINE", default: BLOCK)
|
||||||
- Hidden: Hide the excerpt content (optional, default: false)
|
- Hidden: Hide the excerpt content (optional, default: false)
|
||||||
|
|
||||||
|
* template: `ac:anchor` to set an anchor inside a page
|
||||||
|
- Anchor: Text for the anchor
|
||||||
|
|
||||||
* 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
|
||||||
|
@ -294,6 +294,14 @@ func templates(api *confluence.API) (*template.Template, error) {
|
|||||||
`</ac:structured-macro>{{printf "\n"}}`,
|
`</ac:structured-macro>{{printf "\n"}}`,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
/* https://confluence.atlassian.com/conf59/anchor-macro-792499068.html */
|
||||||
|
|
||||||
|
`ac:anchor`: text(
|
||||||
|
`<ac:structured-macro ac:name="anchor">{{printf "\n"}}`,
|
||||||
|
`<ac:parameter ac:name="">{{ .Anchor }}</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