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 14K
  • Win 7K
  • Mac 4K
  • Linux 3K
Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12
Windows 3 2 2 1 1 2 3 1 5 1 2 2 2 0 5 1 6 4 6 2 2 5 3 2 1 2 2 2 4 2 0 0 0 0 2 4 8 0 1 1 2 2 5 0 0 4
Mac 0 0 0 2 2 0 0 0 2 3 3 3 1 2 4 1 5 3 0 0 0 1 1 3 1 2 2 1 3 1 0 0 0 0 1 2 0 0 0 2 1 1 3 0 0 1
Linux 1 0 1 0 0 2 4 1 1 1 0 2 3 3 4 0 2 2 0 0 0 2 0 1 0 0 0 0 3 1 0 0 0 0 0 0 0 1 0 3 0 1 1 0 0 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. Alternatively you can specify zoom tag: {zoom="1.5"} and the multiplicative zoom factor will be applied on top of the base_zoom config variable.

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