Open lumenpink opened 2 years ago
Thank you for your suggestion. I'm open to supporting this but won't have time to get started for at least a week and a half due to work and holiday.
I'll think about an implementation pattern and get started when I'm back.
Thanks! Have a nice holiday!
I'm considering allowing dasel to deal with multiple formats within a single file by allowing comma separated r
, w
and p
flags.
This would then allow you to read the yaml + json document into a single dasel execution and output in the same way.
That's an awesome idea!
Note that this is a bigger problem than just Frontmatter. YAML generally supports multiple documents in one file. This feature is commonly used by a number of tools, especially in kubernetes. It's supported by yq. The current "dasel" parser does the wrong thing when presented with a multi-document yaml. I'll open a separate, more generic bug on this.
Is your feature request related to a problem? Please describe. Frontmatter is wide used standard to add metadata usually in YAML format to markdown files. It is used in a variety of Static Site Generators like Jekill and Hugo. The format is very simple as a put the YAML between '---' in the init of de markdown file. But, for use it with
dasel
, first I've to extract the YAML withsed
/awk
before. And rewrite the header become very hard.Describe the solution you'd like I would like that
dasel
supports frontmatter.Describe alternatives you've considered To use it now I have to extract the from the header.
Additional context https://jekyllrb.com/docs/front-matter/