Skip to content

Adds size-specified image syntax support to VS Code's builtin markdown preview

License

Notifications You must be signed in to change notification settings

amoosbr/vscode-markdown-imsize

Repository files navigation

vscode-markdown-imsize

Adds markdown-it-imsize syntax support to VS Code's built-in Markdown preview. Overloads original markdown-it image renderer.

Features

Using markdown-it-imsize syntax the size of images can be specified in the markdown document. When viewing the document using VS Code's built-in Markdown preview, the image file will be resized accordingly.

Syntax

Using pixel for image size specification

![sample](sample-image.png =200x100)

is interpreted as

<p><img src="sample-image.png" alt="sample" width="200" height="100"></p>

Note: Width or height can be omitted. In this case the aspect ratio is honored during resize.

![sample](sample-image.png =200x)
or  
![sample](sample-image.png =x100)

Using percentage for image size specification

![sample](sample-image.png =50%x)

is interpreted as

<p><img src="sample-image.png" alt="sample" width="50%"></p>

Examples

Release Notes

0.0.2

Added example images

0.0.1

Initial release suporting markdown-it-imsize syntax

About

Adds size-specified image syntax support to VS Code's builtin markdown preview

Resources

License

Stars

Watchers

Forks

Packages

No packages published