Giter VIP home page Giter VIP logo

Comments (4)

ianstormtaylor avatar ianstormtaylor commented on May 22, 2024

Definitely thought it was sweet when I saw that parsers (and delimiters) were able to be swapped out.

As for what to bundle, I assume you're talking about keeping the yaml parser regardless? Honestly not sure. The js and coffee ones seem a bit opinionated? But built-in json, yaml, toml seems nice for people. Although I'll only ever use yaml like you said. Either just yaml or yaml,json,toml seems right. I guess someone could ask for an xml one, at which point it might be nicer to just have an opinion of only yaml.

Side note: I thought regular JSON was "correct" YAML as well, so technically JSON parsing it automatically handled? I guess the only different is the opening and closing {}. Even the json one might be slightly opinionated in that case, not sure.

from gray-matter.

jonschlinkert avatar jonschlinkert commented on May 22, 2024

Definitely thought it was sweet when I saw that parsers (and delimiters) were able to be swapped out.

thanks! yeah my inner nerd is resisting taking them out...

I assume you're talking about keeping the yaml parser regardless?

yes, definitely.

The js and coffee ones seem a bit opinionated?

noted. I really wasn't sure what to do when I implemented those. it's funny, I've never even used the coffee parser in project (because I forget about it), but I probably should, when I was writing the tests it was pretty fun defining helpers in the front matter and then using them in the same file.

But built-in json, yaml, toml seems nice for people.

also noted. that seems like a good mix.

thought regular JSON was "correct" YAML as well

but I got all excited about being able to let people use JSON lol.

thanks for the feedback Ian. @doowb any thoughts?

from gray-matter.

doowb avatar doowb commented on May 22, 2024

You're already only requiring js-yaml if it's used and also allowing passing in a parser function opts.fn so I think that should be fine, right?

var myParser = require('my-parser');
var parsed = matter(str, { parser: myParser });

from gray-matter.

jonschlinkert avatar jonschlinkert commented on May 22, 2024

closing since gray-matter was refactored. custom engines are now supported via options (parsing and stringifying), and some sensible defaults are still included.

from gray-matter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.