【问题标题】:Including a picture in a markdown file in VScode在 VScode 的 markdown 文件中包含图片
【发布时间】:2021-01-09 17:53:58
【问题描述】:

我必须在 vscode 中使用 markdown 编写文档。 我有一些麻烦,包括我的文件中的图像。我想为我的图像添加标题。 我尝试了关于 thist post 的建议。因此,我创建了一个文件夹“_includes”,并添加了一个带有以下代码的文件 image.html:

<figure class="image">
<img src="{{include.url}}" alt="{{include.description}}">
<figcaption>{{include.description}}</figcaption>

在我的 .md 文件中,我尝试使用

{% include image.html src="/pictures/myimage.svg" description="test" %}

问题是,vscode 似乎无法识别 {% include %} 命令。它只是将代码显示为纯文本。 谁能推荐我解决这个问题?

亲切的问候

【问题讨论】:

    标签: html visual-studio visual-studio-code markdown


    【解决方案1】:

    我之前也遇到过同样的问题。 This 答案最适合我。代码如下:

    ![](path_to_image)
    *image_caption*
    

    我也更喜欢this 的输出视觉效果更好,但它们在功能上都很好。代码:

    | ![space-1.jpg](http://www.storywarren.com/wp-content/uploads/2016/09/space-1.jpg) | 
    |:--:| 
    | *Space* |
    

    (我会将此添加为评论,但我太新在这里无法评论,抱歉。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-31
      • 2022-06-16
      • 2016-10-12
      • 2017-06-17
      • 2011-06-14
      • 1970-01-01
      • 1970-01-01
      • 2017-05-27
      相关资源
      最近更新 更多