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

Markdown Images

by xsleonard ALL

Sublime Text 3 plugin to render images in markdown files

Details

Installs

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

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.

Installation

You can install this package using Package Control using the name “Markdown Images”.

For development, you will want to clone the repository into “Markdown Images” directory in the Sublime Text’s Packages directory (PreferencesBrowse Packages…):

git clone git@github.com:xsleonard/sublime-MarkdownImages.git 'Markdown Images'

(Or create a symlink with such name from your projects directory.)

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

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