Coder Social home page Coder Social logo

josephearl / preliminaries Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonschlinkert/gray-matter

7.0 7.0 2.0 375 KB

Simple front matter parser that parses YAML, JSON and TOML

License: MIT License

JavaScript 98.03% Makefile 1.97%
frontmatter markdown

preliminaries's People

Contributors

ajedi32 avatar doowb avatar heymind avatar ianstormtaylor avatar jonschlinkert avatar josephearl avatar moozzyk avatar robloach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

erquhart smuemd

preliminaries's Issues

preliminaries 2.0.0

The intention for 2.0.0 is to drop auto-registration completely and change the registration syntax.

Parsers will be able to expose a default language (as well as the default delimiters that they can currently).

The new register, unregister, and registerable syntax will allow using different delimiters to those defined by a parser.

Considering splitting the json parser out of core. This would mean re-writing some of the core tests to use a basic test parser instead of assuming json. It would also mean default lang option would need to be exposed. This could be done in the Preliminaries constructor, and would either mean not exposing a shared preliminaries instance, or providing some setter for it.

JS will be re-written as ES6 classes. Classes and default instances of these classes will be exposed. Rollup will be used to produce UMD exports.

Something like Prettier, standardjs or eslint --fix would be a good addition.

Other ideas welcome!

Some examples:

import { preliminaries, jsonParser} from 'preliminaries';
import { yamlParser } from 'preliminaries-parser-yaml';

preliminaries
  .register(jsonParser)
  .register(yamlParser);
import { preliminaries } from 'preliminaries';
import { json5Parser } from 'preliminaries-parser-json5';
import { yamlParser } from 'preliminaries-parser-yaml';

preliminaries
  .register(json5Parser, ['json', 'json5'], ['{', '}'])
  .register(yamlParser);
import { Preliminaries } from 'preliminaries';
import { YamlParser } from 'preliminaries-parser-yaml';

const preliminaries = new Preliminaries();
preliminaries.register(new YamlParser());
import { preliminaries, jsonParser } from 'preliminaries';
import { json5Parser } from 'preliminaries-parser-json5';

preliminaries.register(jsonParser);
preliminaries.registerable(json5Parser, 'json5', ['{', '}']);

With json parser removed from core:

import { Preliminaries } from 'preliminaries';
import { jsonParser } from 'preliminaries-parser-json';
import { yamlParser } from 'preliminaries-parser-yaml';

const preliminaries = new Preliminaries('yaml');
preliminaries
  .register(jsonParser)
  .register(yamlParser);

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.