sparkartgroup / gulp-markdown-to-json

Parse Markdown and YAML → compile Markdown to HTML → wrap it all up in JSON
MIT License
75 stars 14 forks source link

Pass files through if they are already JSON #8

Closed lunelson closed 8 years ago

lunelson commented 9 years ago

This is aimed at opening up the workflow a bit so that other filetypes could be collected and combined to the single 'content' JSON file. I added the 'validator' package here because it offers an easy method for checking if a string is JSON, and modified the parse method to return the file if the check is true.

lunelson commented 9 years ago

I should have made a branch for this first; I've made one now and can re-do the PR if you want

pushred commented 8 years ago

Thanks for the PR! Sorry it took over a year to look at..

I can see this being valuable but JSON.parse in a try/catch (same approach as validator) is preferred over adding that entire lib. I'm currently working on a 1.0 release so I'll go ahead and incorporate this feature into that.