erez
erez

Reputation: 351

Integrate existing yaml file in a .md document

I am looking for a way to integrate an existing yaml file in a .md document. the yaml file resides in a gitub repo and can also be accessed relative to the .md file (for example ../dir/test.yaml) I am using mkdocs for my site.

Upvotes: 1

Views: 3418

Answers (1)

Alinex
Alinex

Reputation: 979

Use the mkdocs-include-markdown-plugin which is added using: pip install --no-cache-dir mkdocs-include-markdown-plugin

Then enable it in mkdocs.yml:

plugins:
  - include-markdown

Now use:

Include relative text:

{% include "../test.yml" %}

Include relative markdown:

{% include-markdown "../README.md" %}

Read more about it under https://github.com/mondeja/mkdocs-include-markdown-plugin or see it on my examples https://alinex.gitlab.io/lang/mkdocs.html#include which are build using https://alinex.gitlab.io/docker-mkdocs/.

Upvotes: 1

Related Questions