I am trying to use the go version of yq to produce markdown from a json array.
Given the following json array:
[
{ "en": "cat", "fr": "chat" },
{ "en": "dog", "fr": "chien" },
{ "en": "fish", "fr": "poisson" }
]
I want to convert to markdown something like:
> cat
- chat
> dog
- chien
> fish
- poisson
I have tried various pipes but all I can come up with does not produce the desired outcome
yq -r '"> " + .[].en, .[].fr' test.json
[WARNING] 10:37:36 JSON file output is now JSON by default (instead of yaml). Use '-oy' or '--output-format=yaml' for yaml output
> cat
> dog
> fish
chat
chien
poisson