All Projects → mnapoli → Frontyaml

mnapoli / Frontyaml

Licence: other
YAML Front matter parser

Projects that are alternatives of or similar to Frontyaml

Obsidian-Markdown-Parser
This repository will give you tools to parse and fetch useful informations of your notes in your Obsidian vault.
Stars: ✭ 32 (-87.1%)
Mutual labels:  yaml, markdown-parser
Config
JSON or YAML configuration wrapper with convenient access methods.
Stars: ✭ 237 (-4.44%)
Mutual labels:  yaml
Java Library Examples
💪 example of common used libraries and frameworks, programming required, don't fork man.
Stars: ✭ 204 (-17.74%)
Mutual labels:  yaml
Sharpyaml
SharpYaml is a .NET library for YAML compatible with CoreCLR
Stars: ✭ 217 (-12.5%)
Mutual labels:  yaml
My Bloody Jenkins
Self Configured Jenkins Docker image based on Jenkins-LTS
Stars: ✭ 205 (-17.34%)
Mutual labels:  yaml
Markdown
A Python implementation of John Gruber’s Markdown with Extension support.
Stars: ✭ 2,725 (+998.79%)
Mutual labels:  markdown-parser
Iamy
A cli tool for importing and exporting AWS IAM configuration to YAML files
Stars: ✭ 200 (-19.35%)
Mutual labels:  yaml
Cloud Code Samples
Code templates to make working with Kubernetes feel like editing and debugging local code.
Stars: ✭ 245 (-1.21%)
Mutual labels:  yaml
Rollback
Ansible role to rollback scripting applications like PHP, Python, Ruby, etc. in a capistrano style
Stars: ✭ 230 (-7.26%)
Mutual labels:  yaml
Markdig
A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
Stars: ✭ 2,730 (+1000.81%)
Mutual labels:  markdown-parser
Mashumaro
Fast and well tested serialization framework on top of dataclasses
Stars: ✭ 208 (-16.13%)
Mutual labels:  yaml
Parsedown
Better Markdown Parser in PHP
Stars: ✭ 13,959 (+5528.63%)
Mutual labels:  markdown-parser
Config
📝 Go config manage(load,get,set). support JSON, YAML, TOML, INI, HCL, ENV and Flags. Multi file load, data override merge, parse ENV var. Go应用配置加载管理,支持多种格式,多文件加载,远程文件加载,支持数据合并,解析环境变量名
Stars: ✭ 225 (-9.27%)
Mutual labels:  yaml
Chronicle Wire
A Java Serialisation Library that supports multiple formats
Stars: ✭ 204 (-17.74%)
Mutual labels:  yaml
Config
Configuration for Go applications
Stars: ✭ 239 (-3.63%)
Mutual labels:  yaml
Ahoy
Create self-documenting cli programs from YAML files. Easily wrap bash, grunt, npm, docker, (anything) to standardize your processes and make the lives of the people working on your project better.
Stars: ✭ 201 (-18.95%)
Mutual labels:  yaml
Yaml
YAML language and community information
Stars: ✭ 208 (-16.13%)
Mutual labels:  yaml
Renderer
Simple, lightweight and faster response (JSON, JSONP, XML, YAML, HTML, File) rendering package for Go
Stars: ✭ 220 (-11.29%)
Mutual labels:  yaml
Vscode Data Preview
Data Preview 🈸 extension for importing 📤 viewing 🔎 slicing 🔪 dicing 🎲 charting 📊 & exporting 📥 large JSON array/config, YAML, Apache Arrow, Avro, Parquet & Excel data files
Stars: ✭ 245 (-1.21%)
Mutual labels:  yaml
Thorsserializer
C++ Serialization library for JSON
Stars: ✭ 241 (-2.82%)
Mutual labels:  yaml

FrontYAML

An implementation of YAML Front matter for PHP. Can parse the YAML and the Markdown.

Build Status Total Downloads

Installation

Require the project with Composer:

composer require mnapoli/front-yaml

Usage

$parser = new Mni\FrontYAML\Parser();

$document = $parser->parse($str);

$yaml = $document->getYAML();
$html = $document->getContent();

If you don't want the Markdown to be parsed (maybe because it is not Markdown):

$document = $parser->parse($str, false);

Example

The following file:

---
foo: bar
---
This is **strong**.

Will give:

var_export($document->getYAML());
// array("foo" => "bar")

var_export($document->getContent());
// "<p>This is <strong>strong</strong></p>"

YAML and Markdown parsers

$parser = new Mni\FrontYAML\Parser($yamlParser, $markdownParser);

This library uses dependency injection and abstraction to allow you to provide your own YAML or Markdown parser.

interface YAMLParser
{
    public function parse($yaml);
}

FrontYAML uses by default Symfony's YAML parser.

interface MarkdownParser
{
    public function parse($markdown);
}

FrontYAML uses by default Parsedown Markdown parser.

An adapter to League CommonMark is also included (you need to require the league/commonmark though):

use \Mni\FrontYAML\Bridge\CommonMark\CommonMarkParser;

$parser = new Mni\FrontYAML\Parser(null, new CommonMarkParser());
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].