Skip to content

Commit

Permalink
Add ac:image width and edited README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Fethbita committed Feb 4, 2023
1 parent 8debc23 commit e0222ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,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:)
```

### Add width for an image

Use the following macro:
```markdown
<!-- Macro: \!\[.*\]\((.+)\)\<\!\-\- (.*) \-\-\>
Template: ac:image
Attachment: ${1}
Width: ${2} -->
```
And attach any image with the following
```markdown
![Example](../images/example.png)<!-- 300 -->
```
The width will be the commented html after the image (in this case 300px).


## Installation

### Homebrew
Expand Down
2 changes: 1 addition & 1 deletion pkg/mark/stdlib/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func templates(api *confluence.API) (*template.Template, error) {
`<ac:emoticon ac:name="{{ .Name }}"/>`,
),
`ac:image`: text(
`<ac:image ac:align="center" ac:layout="center"><ri:attachment ri:filename="{{ .Attachment | convertAttachment }}"/></ac:image>`,
`<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 */
Expand Down

0 comments on commit e0222ae

Please sign in to comment.