josephearl / preliminaries Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jonschlinkert/gray-matter
Simple front matter parser that parses YAML, JSON and TOML
License: MIT License
This project forked from jonschlinkert/gray-matter
Simple front matter parser that parses YAML, JSON and TOML
License: MIT License
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);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.