Domanda

I'm looking for a way to make all my markdown file universal that is work on iOS, Mac, even Linux/Window/Android.

I want to have a single folder where I stick all my images and then point to that folder from whatever OS/device I'm using. For example

~/img/image.png

would be readable in the .md file from anywhere.

Does anything like that exist? Can I use iCloud or Dropbox for that? Are there any other solutions people may suggest?

È stato utile?

Soluzione

I want to have a single folder where I stick all my images and then point to that folder from whatever OS/device I'm using [and] would be readable in the .md file from anywhere.

What you're looking for is a cloud based service. There are several image specific services that can do this for you:

However, you're not limited to a service that only supports images. iCloud (pending), DropBox, OneDrive, etc. all the ability to do what you want. For instance, using the following markdown code, I can insert the following image hosted on my OneDrive account:

Code:    
<img src="https://kl8ofa.bn.files.1drv.com/y4mW66FhA4IBlnLBez4t70-rBq51PBEoTI6USX6Kxn46GjR-xfXtWz3knMJm6MbqIOwqutlneyiaDLQvj_upQgrhVjIsjQFjmHEb_DPIsIwQtzE1KD52cMyrRkZuSFQw-vJdTSkIfQfcU3IOPTj0VxC_o_Sbew8NK7I9RtUBAmfCk1NXqURe0BIVkt2-NeHQhadleH2VG0HN8e5PV3BggllSA?width=2048&height=2048&cropmode=none" width="400"

You can even create a download link to the original wallpaper file by using supported HTML within your markdown:

Code:
<a href="https://1drv.ms/u/s!AmW50NkbWLGik54_9VmMgoY8pczbzg">original wallpaper file</a>

Now, understand, that link must be generated by the service unless you plan to host the images yourself (way too much work!).


More Examples:

Dropbox:

Code to Embed image:
<img src="https://www.dropbox.com/s/h29iren2akr83ii/FreeBSD%20Wallpaper%20-%20Think%20Correctly.png?raw=1 " width="400">

Important note: To embed the image and not make it appear in the DropBox widget, you need to replace the ?dl=0 at the end of the URL with ?raw=1.

Code:
Download link for <a href="https://www.dropbox.com/s/h29iren2akr83ii/FreeBSD%20Wallpaper%20-%20Think%20Correctly.png?raw=1">Think Correctly Wallpaper</a>

Download link for Think Correctly Wallpaper

Box.Com

Unfortunately, you can't embed an image from Box.com because their widget is incompatible with Markdown. However, you can still share the link Apple Leather Desktop Walpaper like the others above.

Code:
<a href="https://app.box.com/s/j68j4nvqcs9uh6zohzisws9o7evnk4kf"> Apple Leather Desktop Walpaper </a>

Image Attribution. None of these wallpapers are mine. They are the work of the original artist and I claim no ownership. These were sent to me or I found them in my travels on the Internet.

Summary

Other than the dedicated services, OneDrive and DropBox seem to have the best integration (IMO) for both embedding and linking images into a markdown document. I'm partial to OneDrive and it's integration directly into macOS, but preferences vary. DropBox is a bit more efficient with respect to the length of the link. Box.com falls short in that you can't embed images but you can link to them.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a apple.stackexchange
scroll top