英文:
Mixing YAML and Markdown
问题
我经常使用 YAML,但我想能够包含链接。我尝试在 YAML 文件中使用 Markdown 链接,但显示了整个标点符号。我还尝试在 Markdown 文件中使用 YAML 格式,但 YAML 行没有缩进。我愿意尝试付费程序,但更愿意先尝试开源程序。谢谢。
我进行了许多浏览器搜索,并尝试了一些我找到的东西。
英文:
I am using YAML quite a bit, but I want to be able to include links. I tried Markdown links in a YAML file, but the entire punctuation is displayed. I tried YAML formatting in a Markdown file, but there is no indentation in the YAML lines. I am open to a paid program, but I'd rather try an open source program first. Thank you.
I did a number of browser searches, and I experimented with some things I found.
答案1
得分: 2
链接只是一个数据点。YAML 是一种数据序列化格式。你当然可以编写:
url: https://example.com
YAML 会将其解析为包含 URL 的映射(URL 很可能是一个字符串,除非你编写了自定义构造函数)。YAML 不会渲染或显示任何内容;使用 YAML 的应用程序可以允许你处理 YAML 输入并显示输出,但这是针对特定应用程序的问题,不能通用回答。
如果你想在 Markdown 文件中包含 YAML 并希望以缩进方式呈现它,请使用代码块,例如:
<!-- language: markdown -->
some:
yaml: data
英文:
A link is just a data point. YAML is a data serialization format. You can of course write
url: https://example.com
and YAML will parse it as mapping that contains a URL (the URL will be most likely a string unless you write a custom constructor). YAML doesn't render or display anything; applications that use YAML might allow you to process YAML input to displayed output, but that would be a question about that specific application and cannot be answered generally for YAML.
If you want to include YAML in a Markdown file and render it with indentation, use a code block, e.g.
<!-- language: markdown -->
```yaml
some:
yaml: data
```
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论