Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert images, relative path(Linux Flatpak) #2382

Closed
kallebl0mquist opened this issue Nov 8, 2020 · 6 comments
Closed

Insert images, relative path(Linux Flatpak) #2382

kallebl0mquist opened this issue Nov 8, 2020 · 6 comments

Comments

@kallebl0mquist
Copy link

Images / Relative Path

Thanks for such a great application! I have a question.
I would like to use markdown documents with different Apps (marktext on linux mint and 1Writer on iOS). I am trying to insert/link images that are in the same folder as the Markdown document. Using relative image paths would allow me to open the markdown file in any context. Moving my notes folder to another location or on a stick wouldn‘t be a problem (Can be easily done in typora for instance). I cannot seem to find a way to achieve that in marktext. I always end up with an absolute path to the image. Am I missing something?
Loading images into the cloud is not an option.

@kazifarhan199
Copy link

Ya, I also use the relative path option extensively. Make a hidden folder in my notes folder, saving all images there. Then I can just copy or sync that folder and it works on all devices. It is a very useful and necessary feature.

Please include this feature 🙂

@bobhy
Copy link

bobhy commented Nov 19, 2020

A simple local path like ![local image](xyz.jpg) renders fine for me (marktext on Windows + Hugo).

Or are you looking for the cut-and-paste of an image onto the marktext page to copy the image file to the folder containing the markdown document?

@flayman
Copy link

flayman commented Nov 21, 2020

What I'm personally looking for is a way to make authoring painless for people who don't want to muck around with Markdown. It's nice to be able to copy and paste an image from a local filesystem, but that doesn't translate paths relative to the document, and I can't expect editors to change the URL that is set in the source. It might be nice if, when you open a folder, subfolders than contain media can display those files and allow the editor to preview them and drag them in.

@kazifarhan199
Copy link

kazifarhan199 commented Nov 22, 2020

I understand. I want to suggest that we allow "move to location" option to take in relative path. i.e relative to the file we are editing

for example, if I set it to "./.assets"

I open file -> image will be placed at

/home/kazi/first.md --> /home/kazi/.assets/
/home/FAR/sec.md --> /home/FAR/.assets/

As the dir where we are moving the image is relative to the file we are editing, we can easily get the relative path.
As we have a relative location already.
I know that it will not give a relative path for images that are not copied to the dir. but that's fine, because if someone is not using the option to "Move to destination" he is probably not syncing his files. In which case he probably does not care about relative path

Bottom line

  • If we allow a relative path for the "move to location" option we can make those paths relative
  • We can make the option "Use relative path where ever possible" to be toggled on only when "move to location" is selected
  • This will allow someone to sync all the files using something like dropbox

Thankyou!

as

@bwl21
Copy link

bwl21 commented Nov 22, 2020

This is basically the reason, why i currently use Typora. on mac I copy a screenshot to the clipboard and past it to markdown. if there is no image folder I am asked to create it.

If the document is not saved, it should ask to save the document first.
It would really be cool to get this feature in Mark Text.

@fxha
Copy link
Contributor

fxha commented Nov 22, 2020

Thank you for reporting the issue and the great discussion but we noticed that this is a duplicate of #549. You may want to subscribe there for further updates.

@KaziFarhanuddin You're right, if images should be relative by default then the image dialog should try to do so or use a fallback option.

@fxha fxha closed this as completed Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants