【问题标题】:Integrate existing yaml file in a .md document将现有的 yaml 文件集成到 .md 文档中
【发布时间】:2021-08-09 09:51:21
【问题描述】:

我正在寻找一种将现有 yaml 文件集成到 .md 文档中的方法。 yaml 文件位于 gitub 存储库中,也可以相对于 .md 文件进行访问(例如 ../dir/test.yaml) 我正在为我的网站使用 mkdocs。

【问题讨论】:

    标签: mkdocs


    【解决方案1】:

    使用 mkdocs-include-markdown-plugin 添加使用:pip install --no-cache-dir mkdocs-include-markdown-plugin

    然后在mkdocs.yml启用它:

    plugins:
      - include-markdown
    

    现在使用:

    Include relative text:
    
    {% include "../test.yml" %}
    
    Include relative markdown:
    
    {% include-markdown "../README.md" %}
    

    https://github.com/mondeja/mkdocs-include-markdown-plugin 下阅读有关它的更多信息,或者在我的示例https://alinex.gitlab.io/lang/mkdocs.html#include 中查看它,这些示例是使用https://alinex.gitlab.io/docker-mkdocs/ 构建的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-28
      • 1970-01-01
      • 1970-01-01
      • 2021-05-10
      • 2016-03-24
      • 1970-01-01
      • 1970-01-01
      • 2021-04-12
      相关资源
      最近更新 更多