Closed ahillio closed 2 years ago
lyaml is a wrapper for libYAML, and I'm afraid neither understand any other file formats such as markdown, json, toml or anything else.
It's trivial to extract the frontmatter if your file starts with ---\n
and encodes frontmatter up to the first ...\n
or next ---\n
, but you'll need to figure out whether that frontmatter data is encoded as yaml (lyaml will decode that for you, including the boundary lines if you'd like) or as json, toml, graphql or some other format (lyaml will not be able to decode those for you).
awesome, thanks!
Am I suppose to parse my markdown files for yaml frontmatter first and then supply that to
lyaml
or doeslyaml
itself have a means for extracting the frontmatter from markdown files?