Skip to content

Commit

Permalink
doc: Document image captions support
Browse files Browse the repository at this point in the history
  • Loading branch information
osulyanov committed Dec 16, 2024
1 parent 445e169 commit 600e76e
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions en/syntax/media.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,33 @@ The standard markup for inserting an image is:
![alt-text](_images/image.png "hint_text" =100x100)
```

* `alt-text`: Alternative image text.
* `_images/image.png`: The URL or path to the image file.
* `"hint_text"`: A hint that will be displayed when you hover over the image. Optional.
* `=100x100`: The image size. Optional.
* `alt-text`: Alternative image text.
* `_images/image.png`: The URL or path to the image file.
* `"hint_text"`: A hint that will be displayed when you hover over the image. Optional.
* `=100x100`: The image size. Optional.

{% note tip %}
{% note tip %}

If you want to keep the aspect ratio of your image, only specify its width: `100x`.
If you want to keep the aspect ratio of your image, only specify its width: `100x`.

{% endnote %}

### Images with captions

You can enable the display of the caption you need to add the { caption } as attribute, the default value is equal to the title, but it can also be passed in the attribute.

```markdown
![Alt text](../../_images/mountain.jpg "Default caption text" =100x100){ caption }

![Alt text](../../_images/mountain.jpg "Title" =100x100){ caption="Specified caption text" }
```

**Result**

![Alt text](../../_images/mountain.jpg "Default caption text" =100x100){ caption }

![Alt text](../../_images/mountain.jpg "Title" =100x100){ caption="Specified caption text" }

{% endnote %}

### Images as links {#image-link}

Expand Down Expand Up @@ -61,4 +78,3 @@ To add videos to a page, use markup:
```

To review the style options and list of available video hosting services, see the [markdown-it-video](https://www.npmjs.com/package/markdown-it-video) plugin page.

0 comments on commit 600e76e

Please sign in to comment.