mindmap-markdown icon indicating copy to clipboard operation
mindmap-markdown copied to clipboard

Add canvas connecting lines for external Simplemind images that don't exist in smmx files

Open djsudduth opened this issue 1 year ago • 61 comments

When images are added to Simplemind mindmaps - there is an option to either embed or have external images. When external images are used, the smmx file does not have any connectors between the nodes and images. Find a way to add external connection lines on the Obsidian canvas.

djsudduth avatar Dec 12 '24 15:12 djsudduth

@djsudduth Thanks for adding to the new conversation.

Hela-Girl avatar Dec 12 '24 16:12 Hela-Girl

@Hela-Girl - our biggest problem with this addition is that Obsidian doesn't have straight or dotted connecting lines between cards. So the lines to images will have to be curved and solid.

djsudduth avatar Dec 13 '24 03:12 djsudduth

https://i.imgur.com/TMCojt7.jpeg

For some reason, no connections with the pictures or the pictures themselves appeared. What am I doing wrong?

python mindmd.py -c -t

Hela-Girl avatar Dec 13 '24 17:12 Hela-Girl

https://i.imgur.com/ncbTA16.jpeg

Hurray, the cards have appeared, but there is no connection to the pictures.

Hela-Girl avatar Dec 13 '24 17:12 Hela-Girl

Maybe you can release it with the same curves?

Hela-Girl avatar Dec 13 '24 17:12 Hela-Girl

If it is possible for cards to use “direct connections” it would be great.

Hela-Girl avatar Dec 13 '24 18:12 Hela-Girl

We'll see - not sure just how it will work yet. The current 0.2.0 doesn't have the connectors yet.

djsudduth avatar Dec 13 '24 18:12 djsudduth

Version 0.2.1 is ready with the lines / connections to images now added! Again, use the -c and -t switches:

python mindmd.py -c -t

Download using the same link from the 0.2.0 version Here -> https://github.com/djsudduth/mindmap-markdown/tree/develop

Choose the Code button / download to get the .zip file of the new beta version

djsudduth avatar Dec 13 '24 23:12 djsudduth

Minor edits:

  1. when converting, is it possible to use jpg or webp instead of png?
  2. I don’t know or it’s a mistake, but if the images were originally not in English, then after conversion they are not there.

https://i.imgur.com/lcwvgSB.jpeg

Hela-Girl avatar Dec 14 '24 06:12 Hela-Girl

for your edits:

  1. It might be possible to change the image format - PNG is the format coming out of Simplemind - it will require a new issue to investigate using the Pillow utility - see #12
  2. I'll take a look - it's probably a unicode language issue.

Thanks for testing it!

djsudduth avatar Dec 14 '24 14:12 djsudduth

Ok, I fixed number 2 in your list. It was just a naming bug. Just download the latest 0.2.1 again from the link above.

djsudduth avatar Dec 14 '24 17:12 djsudduth

https://www.mediafire.com/file/rlmtip4amav7qtx/111.zip/file an example in which the names of the attached images are not in English.

Hela-Girl avatar Dec 14 '24 20:12 Hela-Girl

This worked fine! All is good.
Download using the same link from the 0.2.1 version Here -> https://github.com/djsudduth/mindmap-markdown/tree/develop

Choose the Code button / download to get the .zip file of the new beta version

Map

djsudduth avatar Dec 14 '24 20:12 djsudduth

  1. I noticed a minor error from the "images" folder: it does not transfer images to the "media" folder.
  2. There are images that are inserted into the block for them, can they be taken if they cannot be inserted into the block the same way?

https://i.imgur.com/H8G5pae.jpeg

https://i.imgur.com/883wvxg.jpeg

Hela-Girl avatar Dec 15 '24 10:12 Hela-Girl

Ok!! So glad you found 1. - missing images in the media folder. It happened to me once and I thought I was imagining it. But, there wasn't an error message - yet the media folder was empty. I'll look into that.

I'm not quite sure what you mean by 2. Obsidian cards cannot have images within them unless they are markdown notes. So, if images are within a Simplemind node, they are placed just next to the card unless you choose to have all Simplemind nodes be markdown files. Can you explain more?

djsudduth avatar Dec 15 '24 15:12 djsudduth

  1. You are very insightful. You understood everything correctly.

Please tell me if you could put the necessary module for converting images into jpg / png format in the folder with your plugin. So that when converting, people don’t have to search for and download the required module? (It’s not clear what to just do the conversion without additional searches 😄)

Hela-Girl avatar Dec 15 '24 15:12 Hela-Girl

P.S.: It’s a pity that obsidian has so few possibilities for connections/lines and possible manipulations with lines. SimpleMind has a much better release in this regard.

Hela-Girl avatar Dec 15 '24 15:12 Hela-Girl

I tried to reproduce 1 - images not moving to media. They all transfer as far as I can tell. But, if there are a lot of images you have to restart Obsidian to see them all - you can't leave Obsidian running or the images won't all refresh on the screen making it look like images are missing.

djsudduth avatar Dec 15 '24 17:12 djsudduth

I don’t know or I understood you correctly, but the images from the “images” folder can simply be copied with a script to the “media” folder, as I did it manually. And it worked for me.

Hela-Girl avatar Dec 15 '24 19:12 Hela-Girl

I was just saying that whenever I run the program, all of the files are moved to the "media" folder successfully. I've tried it with your samples and all worked just fine. However, in order to see them in Obsidian, you have to shut Obsidian down and restart it.

djsudduth avatar Dec 15 '24 22:12 djsudduth

Please tell me where to download the updated version of the script with the removal of “media” and images in the topic (within the topic). Or is it still being developed?

Hela-Girl avatar Dec 16 '24 12:12 Hela-Girl

And I also noticed an error occurs if the file name *.smmx is not in English. The example "Позы.smmx" gives an error, but if you rename it to Pose.smmx, everything works fine.

Hela-Girl avatar Dec 16 '24 12:12 Hela-Girl

@Hela-Girl - I don't understand what you mean by "removal of “media” and images in the topic (within the topic)" What are you looking for? Right now, if you embed media within the topic, the image will appear either inside the markdown note if not using the cards. If you are using the card view then the image is placed outside the card next to it.

djsudduth avatar Dec 16 '24 16:12 djsudduth

https://i.imgur.com/kugIsDV.jpeg

  1. In the SimpleMind program, an image can be inserted into a “topic” (1 image), but Obsidian cannot do this. Was there a question or did you correct the fact that images in Obsidian will be linked to the topic?

  2. After the script has finished running, there is a “media” folder in the “betamarkdown” folder and it is always empty for me. I move the images from the "images" folder to the "media" folder and everything works fine for me. (rebooting Obsidian) Question or did you fix this issue?

Hela-Girl avatar Dec 16 '24 16:12 Hela-Girl

P.S.: Sorry, I’m a little confused with the edits that have been made or those that will be made.

Hela-Girl avatar Dec 16 '24 16:12 Hela-Girl

For 1: If you export a simplemind file that has an embedded image to an Obsidian canvas with only cards, the embedded image is extracted and placed next to the card in Obsidian. That is working now.

For 2: Check your Settings.cfg file to make sure the images are going to the media folder (I think there was a mistake in one of the beta versions that changed the config and put the images in /ddd/media folder accidently). Here's what the default Settings should be:

[SETTINGS]
input_path = mindmaps/
output_path = markdown/
media_path = media/
test_file_name = HII Regions.smmx
canvas_scale = 2.2
obsidian_vault_name = Obsidian

Here's how I have mine setup to publish directly to the Obsidian vault:

[SETTINGS]
input_path = mindmaps/
output_path = C:/Users/Username/Google Drive/Obsidian/Canvas
media_path = media/
test_file_name = HII Regions.smmx
canvas_scale = 2.2
obsidian_vault_name = Obsidian

djsudduth avatar Dec 16 '24 17:12 djsudduth

[SETTINGS] input_path = mindmaps/ output_path = betamarkdown/ media_path = media/ test_file_name = 3333.smmx canvas_scale = 1 obsidian_vault_name = Obsidian/

These are my settings:

Hela-Girl avatar Dec 16 '24 17:12 Hela-Girl

So, any time you run the program, the images are not in the betamarkdown/media folder?

djsudduth avatar Dec 16 '24 17:12 djsudduth

no only in "images"

Hela-Girl avatar Dec 16 '24 17:12 Hela-Girl

Can you look within your betamarkdown/ folder and see if the images are somewhere else within it?

What OS / Version are you running? I'm running on Windows 10.

djsudduth avatar Dec 16 '24 17:12 djsudduth