ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Markdown Images

by xsleonard ALL Trending

Sublime Text 3 plugin to render images in markdown files

Details

Installs

  • Total 2K
  • Win 901
  • Mac 536
  • Linux 331
Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27
Windows 1 6 7 4 5 5 2 3 6 4 8 3 10 1 0 4 7 3 7 5 8 2 7 11 5 10 6 3 6 7 9 4 6 5 6 6 10 2 3 7 3 4 5 8 5 7
Mac 0 6 6 4 4 3 2 1 2 1 2 3 4 4 2 1 0 2 2 4 4 2 4 4 8 6 2 3 1 3 2 4 2 5 2 2 4 5 4 1 0 3 1 1 3 3
Linux 3 3 1 2 2 2 4 2 2 1 0 1 2 1 1 2 1 1 2 1 1 0 0 4 2 1 3 2 4 3 2 4 6 3 2 2 0 3 5 4 2 2 3 3 2 0

Readme

Source
raw.​githubusercontent.​com

Markdown Images

This is a Sublime Text 3 plugin to render images inside of markdown files.

Example

Usage

Images in markdown use the ![alt text](uri) markup. Wherever this appears, this plugin can render the image specified by the URI below the line.

You can configure an image's dimensions by adding HTML <img> properties after the image markup: ![alt text](uri){width="200", height="200"}. Everything between the {} will be copied to the <img> element that renders the image.

If the URI points to a file on disk, it is called a “local” image, and renders by default. If the URI points to an external (http, https, etc) resource, it is called a “remote” image, and does not render by default.

You can choose to show local, show remote or show all images from the command palette and with the configuration settings.

Limitations

Sublime's markdown parser only recognizes an image URL if these conditions are met: - There is no whitespace in the URL or filepath. - The “alt text” section of the image markup is not empty (it can have whitespace).

Configuration

By default, images are rendered when the file is first loaded. This can be configured with the show_local_images_on_load and show_remote_images_on_load settings.

Images can rendered on save with the show_local_images_on_post_save and show_remote_images_on_post_save settings.

Go to Sublime Text -> Packages -> Package Settings -> MarkdownImages (macOS menu) to edit your configuration.

Refer to the default configuration file.

Commands

  • markdown_images_show(show_local: bool, show_remote: bool) - Show images from the local filesystem and/or remote URLs
  • markdown_images_hide() - Removes all rendered images from the view

These can be activated with the command palette (cmd+shift+p):

  • MarkdownImages: Hide Images
  • MarkdownImages: Show All Images
  • MarkdownImages: Show Local Images
  • MarkdownImages: Show Remote Images

Keybindings

This plugin adds no keybindings. You can set your own keybindings to the commands.

Notes

The URI portion of the ![alt text](uri) markup must not contain spaces or else the markdown syntax parser (provided by other packages) will not recognize this as image markup.

Only PNG, JPG and GIF images are supported.

SVG does not render inside of ST3 Phantom objects, unfortunately.

Remote image loading runs in the main thread so it will stall ST3. Remote image loading is disabled

Credits

The image rendering code was seeded by sublime_zk