gray-matter VS commonmark-spec

Compare gray-matter vs commonmark-spec and see what are their differences.

gray-matter

Smarter YAML front matter parser, used by metalsmith, Gatsby, Netlify, Assemble, mapbox-gl, phenomic, vuejs vitepress, TinaCMS, Shopify Polaris, Ant Design, Astro, hashicorp, garden, slidev, saber, sourcegraph, and many others. Simple to use, and battle tested. Parses YAML by default but can also parse JSON Front Matter, Coffee Front Matter, TOML Front Matter, and has support for custom parsers. Please follow gray-matter's author: https://github.com/jonschlinkert (by jonschlinkert)

commonmark-spec

CommonMark spec, with reference implementations in C and JavaScript (by commonmark)
SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
gray-matter commonmark-spec
17 48
3,780 4,835
- 0.1%
1.2 6.9
20 days ago 3 months ago
JavaScript Python
MIT License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

gray-matter

Posts with mentions or reviews of gray-matter. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-05.
  • Building a flat-file CMS with Angular
    3 projects | dev.to | 5 Mar 2024
    Writing in markdown is super convenient, and supported by just about any text editor. To convert these .md files to browser-ready HTML, I wrote a simple little Node.js script using two great npm packages called gray-matter and showdown.
  • Eleventy vs. Next.js for static site generation
    4 projects | dev.to | 14 Dec 2023
    Next, install gray-matter to extract metadata from the front matter of markdown files, and marked to convert the markdown files to HTML:
  • Exploring the code behind Docusaurus
    4 projects | dev.to | 30 Oct 2023
    It turns out that Docusaurus uses an open source JavaScript parser called gray-matter to parse the front matter from markdown files! After installing gray-matter using npm and them importing it into the markdownUtils.ts file, all it takes is calling the matter method and passing the markdown file contents to get returned an Object with data and content (the data being the front matter and the content being the rest of the markdown file contents).
  • Create an Interactive Table of Contents for a Next.js Blog with Remark
    5 projects | dev.to | 21 Apr 2023
    Although we are building a custom table of contents, we won't have to write everything from scratch. To separate the Markdown/MDX content from the front matter, we'll use the Gray-matter package. It is optional in case you don't have front matter in your Markdown files. To process the Markdown itself, we'll use the Remark package. We'll also need the unist-util-visit package for traversing node trees and mdast-util-to-string for getting the text content of a node.
  • Create your own blog with MDX and NextJS
    2 projects | dev.to | 5 Dec 2022
    In this article we walk you through the process of creating a simple blog app using the popular React framework NextJS, gray-matter and next-mdx-remote.
  • NextJS 13 Blog Starter
    6 projects | dev.to | 14 Nov 2022
    In order to get post information (such as author, title, date, etc.) from our HTML without having them be apart of our rendered post we need a way to parse YAML front matter, this is where gray-matter comes in hand.
  • Loading local markdown blog posts - part 12
    1 project | dev.to | 18 Oct 2022
    To do this, we use the matter npm package.
  • Create a Markdown Editor with Rust and React
    12 projects | dev.to | 13 Oct 2022
    It’s actually not part of the CommonMark spec, so you’ll often need a 3rd party library to parse it out on top of your Markdown parser. In JavaScript we use gray-matter which converts frontmatter into a JS object we can more easily use.
  • Turn a Markdown blog to a simple SSG
    4 projects | dev.to | 30 Jul 2022
    Over the past few weeks, I mostly wrote on how to template a Node.js application with EJS using Express. Then, I wrote an article showing how to create a Markdown blog in Node.js using EJS, Express, gray-matter and markdown-it. Today, I'll combine those tutorials to turn the Markdown blog, from the last tutorial, into a simple SSG.
  • Markdown blog with EJS
    3 projects | dev.to | 25 Jul 2022
    gray-matter, to parse the front matter from the Markdown files

commonmark-spec

Posts with mentions or reviews of commonmark-spec. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-06.
  • How to add a man page to your Ruby project, using kramdown-man and markdown
    2 projects | /r/ruby | 6 Dec 2023
    Edit: this is because GitHub uses cmark-gfm, which is a fork of cmark, which implements the CommonMark variant of markdown. Looks like CommonMark still doesn't support definition lists. :(
  • How do you host documentation for your spouse or other users?
    4 projects | /r/selfhosted | 6 Dec 2023
    BookStack dev here. There's no specific "import" option but you can use the Markdown editor in BookStack and paste in your Markdown content there. The API is essentially just an endpoint to accept the same kind of data, for of course you could automate against the API for batch import. One thing to keep in mind is that BookStack markdown support is fairly tightly scoped to (commonmark + tables + tasklists), although HTML within MD is supported.
  • On why Markdown is not a good, or even a half-decent, markup language
    9 projects | news.ycombinator.com | 19 Jul 2023
    >A single canonical reference

    https://commonmark.org/

  • Get ready for Bear 2 - We have a quick blog post with some important details and ways you can get notified once it's out!
    1 project | /r/bearapp | 6 Jul 2023
    Typically with major new releases of software, when the number left of the dot (e.g. 2.0) increases, it’s shipped as a separate product. Not always, but generally. The Bear folks can speak for themselves but IIRC a lot of the code was refactored / rewritten to support, for example, CommonMark. So, under the hood, it’s literally brand new in some respects.
  • Best website to write a rulebook for ttrpgs
    3 projects | /r/rpg | 17 May 2023
    I use Obsidian (https://obsidian.md) for a lot of things, including my RPG stuff, and there are options for exporting things as PDFs. It’s great for getting organized and doing research, but I would use other tools for long-form writing and layout. What I like about Obsidian though is that everything is done in Markdown (https://commonmark.org) and I can use Pandoc (https://pandoc.org) to transform the source to whatever I need. The caveat is that Obsidian uses a flavor of Markdown with some non-standard extensions, so a pure Markdown editor like Typora (https://typora.io) might be a better choice depending on your needs.
  • What is the most minimal, strictest variant of Markdown?
    1 project | /r/Markdown | 18 Apr 2023
  • How to display an image
    1 project | /r/gohugo | 11 Apr 2023
    yes, this is the "inventor" of markdown and those rules will always work. Hugo uses something called "Commonmark" which is developed on top of the original markdown. But the original rules will always work too.
  • Lightweight Markup for Ukrainian Texts?
    1 project | /r/Ukrainian | 10 Apr 2023
    Reddit and many other sites support Markdown as an easy way to add emphasis, links, headings, etc. Markdown does not contain any keywords, as it is intended to be language-independent. However, Markdown syntax makes heavy use of square brackets [] and other characters that are difficult to type with an Ukrainian keyboard layout, e.g., the backtick `.
  • I wish Asciidoc was more popular
    4 projects | /r/programming | 6 Feb 2023
    Check out commonmark, that is the Markdown standard supported by numerous converters including pandoc.
  • I wrote a markdown to html converter
    6 projects | /r/golang | 1 Feb 2023
    And if this is an exercise into that you can use a Markdown spec like CommonMark which is the spec Reddit and a variety of other sites use.

What are some alternatives?

When comparing gray-matter and commonmark-spec you can also consider the following projects:

front-matter - Extract YAML front matter from strings

pandoc - Universal markup converter

react-markdown - Markdown component for React

kramdown - kramdown is a fast, pure Ruby Markdown superset converter, using a strict syntax definition and supporting several common extensions.

remark - markdown processor powered by plugins part of the @unifiedjs collective

marktext - 📝A simple and elegant markdown editor, available for Linux, macOS and Windows.

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

markdown-it-katex - Add Math to your Markdown with a KaTeX plugin for Markdown-it

docsify - 🃏 A magical documentation site generator.

Joplin - Joplin - the secure note taking and to-do app with synchronisation capabilities for Windows, macOS, Linux, Android and iOS.

next-markdown-blog - A lightly opinionated, full-featured Next.js blog managed through Git Workflows with markdown files.

rehype-sanitize - plugin to sanitize HTML