Sublime Forum

Inline Images

#1

Displays images inline to enhance comments in code. Sometimes it can be useful to explain something with an image. It detects Markdown-style image links in single line comments: // ![](example.png).

2 Likes

#2

Thanks , but it doesn’t seem to be working for me on ST4. These are the settings I have set:

// File extensions to enable this plugin for
"extensions": [".md"],

// Maximum width applied to all images.
// NOTE: If your view buffer goes blank, this number is too high.
"img_maxwidth": 1024,

// set to true if you want remote images to be loaded and displayed on_load
"show_remote_images_on_load": true,

// set to true if you want local images to be displayed on_load
"show_local_images_on_load": true,

// set to true if you want local images to display on_post_save
"show_local_images_on_post_save": false,

// set to true if you want remote images to display on_post_save
"show_remote_images_on_post_save": false,

0 Likes

#3

Did you install MarkdownImages? That’s not my plugin.

Try restarting Sublime. It has bugs…

0 Likes

#4

No. I installed your plugin. Added the github repo first and installed it through package control. I also restarted Sublime Text.

0 Likes

#5

Hmm. Well, if you look at this file

there is no "extensions" setting, because I changed it to "syntax_filter". You don’t have my addon. And I believe my addon doesn’t actually work for Markdown. Do you even want my addon? :slight_smile:

How exactly did you install it? What do you mean by “added the github repo”? Which one? How did you install through Package Control? I put in a pull request but it didn’t go through yet. My addon is not on Package Control.

Sorry, but I’m super confused. This is the first time I’ve released an addon.

0 Likes

#6

I removed that. Still didn’t work.

I do.

Well that figures.

I have it installed.

Your repository.

I clicked on the green button on github. copied the url. open the command palette. select add repository. paste the url. the rest is history.

1 Like

#7

Hey, thank you for the detailed reply. Sorry that it’s so difficult to get it to work. :frowning:

I added Installation instructions. Hope it helps.

I’ve never used Package Control’s Add Repository before. I couldn’t get it to work either with my addon. It says “successfully added”, but it doesn’t seem to do anything.

I hope that the addon will be added to Package Control soon, which should make installation much easier.

1 Like

#8

This command adds the repository you give it to the list of packages that it knows about; you still have to Package Control: Install Package and choose it from the list to install it.

0 Likes

#9

Oh, nice. That almost works. The plugin is loaded, and loads images.

The URL that I add is https://github.com/haferburg/Sublime-Inline-Images. That causes Package Control to create a Sublime-Inline-Images.sublime-package. However, my addon expects to be called “Inline Images”.

Here’s how I implemented loading the settings:

image

Is there a way to tell Package Control the name of my addon? Or a better solution for loading the settings file? I could not find documentation of even this ${packages} variable, are there other variables like this?

0 Likes

#10

Packages installed this way indeed take their name from the repository that they come from.

In cases where the name of the repo doesn’t match the name of the package, there needs to be a mapping that tells PC what to name things. One way to do that is in the channel file (where you made your PR) ; there’s a field that you can use to specify the name of the package.

For packages installed this way, you can open the settings for Package Control and include this setting:

	// This helps solve naming issues where a repository it not named the
	// same as the package should be. This is primarily only useful for
	// GitHub and BitBucket repositories. This mapping will override the
	// mapping that is retrieved from the repository channels.
	"package_name_map": {},

It’s empty by default as seen here, but you can use this to map the name of the repository to the name of the package; then when you install, PC will name it correctly.

1 Like

#11

Hmm, that is not ideal. I wouldn’t want to tell people in the installation instructions that they have to change the PaCo settings…

I tried to add this JSON from my pull request as a channel, because it has a “name” entry.
image

		{
			"name": "Inline Images",
			"details": "https://github.com/haferburg/Sublime-Inline-Images",
			"releases": [
				{
					"sublime_text": ">=4000",
					"tags": true
				}
			]
		},

But that didn’t work either.

0 Likes

#12

If you add a JSON file, it needs to look like this:

If you’re storing it on GitHub, you can provide the URL to the JSON file directly, but use the raw version of the URL. such as is described here: https://github.com/STealthy-and-haSTy/SublimePackages

0 Likes

#13

Hmm I think that’s what I did. Here’s the URL: https://raw.githubusercontent.com/wbond/package_control_channel/ee1147137af40dc666be93d2d7efbb54bf99996f/repository/i.json

0 Likes

#14

To be clear, my comment was meant to mean that you need to include an entire file including the structure outlined, not just the segment that you posted in your question.

It’s also worth pointing out that Package Control won’t list packages that are already installed.

0 Likes

#15

I couldn’t get the channel thing to work, but it doesn’t matter. I’ll just wait for my PR to go through.

With the package_name_map setting I was able to make sure that PaCo is going to work, so that’s very good. Thank you for your help, OdatNurd.

1 Like