question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to reference an image file from the same directory as the MarkDown file?

See original GitHub issue

This is just for convenience sake, mostly. I have a lot of notes with a lot of images. Set images from %image_url% is not as convenience than having the image in the same directory as the MarkDown (.md) files.

So instead of this.

![%image_url%/image-1.png](%image_url%/image-1.png)

I will just need to do this.

![./image-1.png](./image-1.png)

Is this possible?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
philipstratfordcommented, Oct 16, 2019

I agree that having to put all of the images relating to your documentation (ours will have hundreds) in the images folder very separate from the content is not ideal. Also, the fact that the designated images folder is located inside themes/default/public very much suggests that it’s intended for images relating to the site’s overall theme, not the actual content itself.

A location for images inside the content folder would make more sense (the images are as much part of the documentation’s content as the text), and the ability to have images stored basically anywhere within the content folder and referenced in documents using relative paths would allow me to organise my images with my .md files, which would be much more convenient.

0reactions
cyberiencecommented, May 31, 2021

Its probably useful to note that, many IDE where you can edit markdown, can display the image inline when its in the relative path… but having to place images into an image folder means the IDE for example in webstorm will not represent the edited page since it is not correctly referencing a rooted image path. This is open source project, and I am not a javascript programmer, so hopefully someone would like to take on this challenge. since this issue has been pending 5 years already. maybe quicker if I lean javascript. lol

Read more comments on GitHub >

github_iconTop Results From Across the Web

Store images in same directory as markdown file #2169 - GitHub
I paste an image from the clipboard: Mark Text stores the image in the same directory as the .md file I am editting...
Read more >
How do I display local image in markdown? - Stack Overflow
Either put the image in the same folder as the markdown file or use a relative path to the image.
Read more >
Getting Images into Markdown Documents and Weblog Posts ...
Type it in using Markdown ![](image. · Using the Embed Image Dialog to select images or Urls · Paste images from the Clipboard...
Read more >
How to: Embed an image in a Markdown file - YouTube
Learn how to embed images in a markdown file ============Thank you for viewing this video. Please do subscribe to our channel for more...
Read more >
Images in Typora
Since a Markdown file is a plain text file, you cannot insert image data into Markdown file directly, but instead insert references to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found