mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
commit
e754bf17a0
16
README.md
16
README.md
@ -512,6 +512,22 @@ This is a [link to an existing confluence page](ac:Pagetitle)
|
|||||||
And this is how to link when the linktext is the same as the [Pagetitle](ac:)
|
And this is how to link when the linktext is the same as the [Pagetitle](ac:)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Add width for an image
|
||||||
|
|
||||||
|
Use the following macro:
|
||||||
|
```markdown
|
||||||
|
<!-- Macro: \!\[.*\]\((.+)\)\<\!\-\- width=(.*) \-\-\>
|
||||||
|
Template: ac:image
|
||||||
|
Attachment: ${1}
|
||||||
|
Width: ${2} -->
|
||||||
|
```
|
||||||
|
And attach any image with the following
|
||||||
|
```markdown
|
||||||
|
<!-- width=300 -->
|
||||||
|
```
|
||||||
|
The width will be the commented html after the image (in this case 300px).
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Homebrew
|
### Homebrew
|
||||||
|
@ -84,6 +84,13 @@ func templates(api *confluence.API) (*template.Template, error) {
|
|||||||
"]]><![CDATA[]]]]><![CDATA[>",
|
"]]><![CDATA[]]]]><![CDATA[>",
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
"convertAttachment": func(data string) string {
|
||||||
|
return strings.ReplaceAll(
|
||||||
|
data,
|
||||||
|
"/",
|
||||||
|
"_",
|
||||||
|
)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -210,6 +217,9 @@ func templates(api *confluence.API) (*template.Template, error) {
|
|||||||
`ac:emoticon`: text(
|
`ac:emoticon`: text(
|
||||||
`<ac:emoticon ac:name="{{ .Name }}"/>`,
|
`<ac:emoticon ac:name="{{ .Name }}"/>`,
|
||||||
),
|
),
|
||||||
|
`ac:image`: text(
|
||||||
|
`<ac:image {{ if .Width}}ac:width="{{ .Width }}"{{end}}><ri:attachment ri:filename="{{ .Attachment | convertAttachment }}"/></ac:image>`,
|
||||||
|
),
|
||||||
|
|
||||||
/* https://confluence.atlassian.com/doc/widget-connector-macro-171180449.html#WidgetConnectorMacro-YouTube */
|
/* https://confluence.atlassian.com/doc/widget-connector-macro-171180449.html#WidgetConnectorMacro-YouTube */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user