有人知道如何在markdown显示本地图像吗?我不想为此设置网络服务器。
我尝试以下markdown,但它不起作用:

有人知道如何在markdown显示本地图像吗?我不想为此设置网络服务器。
我尝试以下markdown,但它不起作用:

我怀疑这条路不对。正如user7412219所提到的,ubuntu和windows处理路径不同。试着把图片和你的笔记本放在同一个文件夹中,并使用:

在windows上,桌面应该在:C:\Users\jzhang\Desktop
要在markdown文件中添加图像,.md文件和图像应该在同一个目录中。在我的情况下,我的.md文件是在doc文件夹,所以我也移动图像到相同的文件夹。然后在.md文件中写入以下语法

[汽车图片](Car .png)
这对我来说很有效。
最好的解决方案是提供一个相对于md文档所在文件夹的路径。
浏览器在尝试解析本地文件的绝对路径时可能遇到了麻烦。这可以通过通过web服务器访问文件来解决,但即使在这种情况下,图像路径也必须是正确的。
在文档的同一级别设置一个文件夹,包含所有图像,这是最干净和最安全的解决方案。 它将加载到GitHub,本地,本地web服务器。
images_folder/img.jpg < works
/images_folder/img.jpg < this will work on webserver's only (please read the note!)
使用绝对路径,图像只能通过如下url访问:http://hostname.doesntmatter/image_folder/img.jpg
我有一个解决办法:
a)互联网示例:

b)本地图像示例:


涡轮字节
添加一个本地图像对我来说是这样的:
没有文件://前缀,它不能工作(Win10, notepad++与MarkdownViewer++插件)
编辑:我发现它也适用于html标签,这是更好的方式: <img src="file://IMG_20181123_115829.jpg" alt="alt text" width="200"/> .jpg
Edit2:在Atom编辑器中,它只在没有file://前缀的情况下工作。真是一团糟。
我在R Markdown中插入图像时遇到了问题。如果我做整个URL: C:/Users/Me/Desktop/Project/images/image.png,它倾向于工作。否则,我必须把标记放在与图像相同的目录中,或者放在它的祖先目录中。在引用图像时,似乎忽略了声明的编织目录。
类unix操作系统的解决方案。
STEP BY STEP :创建一个名为Images的目录,并放置所有将由Markdown呈现的图像。 例如,将example.png放到Images中。 加载之前位于Images目录下的example.png。

注意:图像目录必须位于markdown文本文件的相同目录下,扩展名为.md。
编辑:
为我工作(本地形象)

tree
├── doc
└── jobsSystemSchema.jpg
├── README.md
markdown文件README。Md与doc目录处于同一级别。
在您的情况下,您的降价文件应该与目录文件处于同一级别。
为我工作(带原始路径的绝对url)

不为我工作(url与blob路径)

据我所知,对于Linux上的VSCode,只有当您将映像放入与.md post文件相同的文件夹中时,本地映像才能正常显示。 即只有! [](image.jpg)或将工作。 甚至像这样的绝对路径也不能工作。
在Jupyter笔记本Markdown,您可以使用
<img src="RelPathofFolder/File" style="width:800px;height:300px;">
根据你的工具-你也可以注入HTML markdown。
<img src="./img/Isolated.png">
这假设你的文件夹结构是:
├── img
└── Isolated.jpg
├── README.md
你可能会发现下面的语法类似于markdown中的引用链接,特别是当你有一个文本有许多相同的图像显示时:
![optional text description of the image][number]
[number]: URL
例如:
![][1]
![This is an optional description][2]
[1]: /home/jerzy/ComputerScience/Parole/Screenshot_2020-10-13_11-53-29.png
[2]: /home/jerzy/ComputerScience/Parole/Screenshot_2020-10-13_11-53-30.png
如果图像有括号,它将不会显示
.png)
重命名图像并删除括号

更新: 如果你在文件路径中有空格,你应该考虑重命名它,或者如果你使用JavaScript,你可以使用它编码
encodeURIComponent(imagePath)
此外,总是尝试用小写字母来保存图像和文件,请养成这个习惯,尽管这只是我个人的观点
基本语法是。在我的例子中,我使用的图像名称为Any\ image \ of\ your\ choice.png In 而不是,这是行不通的。所以我会说,确保检查图像目录和图像名称不包含空格,如果这样使用下划线(_)而不是空格。
Ubuntu 18.04在Jupyter笔记本上使用markdown时遇到问题。
这对我来说在ubuntu中很有效:

降价文件在:
/home/gps/Documents/Markdown/
图片文件在:
/home/gps/Pictures/