jonschlinkert / 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
https://github.com/jonschlinkert
MIT License
3.97k stars 138 forks source link

Parser for org mode tags [FEATURE REQUEST] #79

Closed HaoZeke closed 6 years ago

HaoZeke commented 6 years ago

Similar to YAML, org files often have a particular markup:

#+TITLE:       Something
#+AUTHOR:      Someone
#+EMAIL:       e@mali.com
#+DATE:        2015-06-12 Sun
#+URI:         /blog/%y/%m/%d/title/
#+KEYWORDS:    some,stuff,this,says
#+TAGS:     blah
#+LANGUAGE:    en
#+OPTIONS:     H:3 num:nil toc:nil \n:nil ::t |:t ^:nil -:nil f:t *:t <:t
#+DESCRIPTION: I speak of tests

Which should be equivalent to:

title:       Something
author:      Someone
email:       e@mali.com
date:        2015-06-12 Sun
uri:         /blog/%y/%m/%d/title/
keywods:    some,stuff,this,says
tags:     blah
language:    en
options:     H:3 num:nil toc:nil \n:nil ::t |:t ^:nil -:nil f:t *:t <:t
description: I speak of tests

Would this be a viable feature?

doowb commented 6 years ago

Thanks for the issue!

You can use the engines option to add your own parser. The coffeescript example is a good one showing how a different parser is used.

I'm going to close this, but please feel free to post back with an example of using an org parser and maybe consider adding a PR with an example using it, if you have one.