-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multi-format frontmatter parser #348
Add multi-format frontmatter parser #348
Conversation
I feel like the |
Renamed to |
Hey @josephearl - awesome work on this! In considering |
@erquhart There's a PR that's been open in that repository jonschlinkert/gray-matter#15 a while now to do some of the same things (separate out at the parsers), so although it would be good to get some of the changes merged upstream -- I'm not sure how quick a process that will be, if it happens. |
Fair point, that repo does seem to be slow moving as of late. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@josephearl last thought on this - might be good to at least raise an issue in gray-matter and give a heads up. You put in some serious work, and the community will likely benefit more from it if you can get the changes in on that repo. I'm guessing from the lack of movement there that the author could use some help. |
indeed! I would love some help on gray-matter! @josephearl you've done some great work, I added you as a collab on gray-matter. (sorry for the very late response!) |
Hi @erquhart, I just pushed up 3.0 of gray-matter, which adds support for excerpts, and simplifies adding parsers/stringifiers for other formats. Fwiw, after reviewing preliminaries more, I don't see anything that it really added even to the previous version of gray-matter, it looks like the code was mostly just reorganized into sub-projects (and the gray-matter pr that "had been open a while" was an anomoly on gray-matter. There had been other issues and updates since that pr was made, so I'm not sure why it was singled out). In any case, would you be open to a pr to use gray-matter 3.0 directly instead of a fork? |
Hey @jonschlinkert - definitely, that was the hope from the beginning. Thank you! |
great, I'll put a pr together as soon as I have a chance. thanks! |
- Summary
Adds the ability to read front matter in TOML and JSON formats. Fixes #227.
Currently
sortedKeys
is not implemented when stringifying, neither are the custom types when parsing or stringifying since these were YAML specific. I can add these if it's a blocker.- Test plan
Added tests for the new parser.
- Description for the changelog
Added dependency on preliminaries.
Added tests for basic parser cases expected to work in netlify-cms.
- A picture of a cute animal (not mandatory but encouraged)