An open API service indexing awesome lists of open source software.

https://github.com/bulldogcreative/front-matter

YAML and Markdown parser. Useful for creating static HTML from files.
https://github.com/bulldogcreative/front-matter

front-matter front-matter-parser markdown php yaml

Last synced: about 1 month ago
JSON representation

YAML and Markdown parser. Useful for creating static HTML from files.

Awesome Lists containing this project

README

          

# Front Matter

[![Build Status](https://travis-ci.org/bulldogcreative/front-matter.svg?branch=master)](https://travis-ci.org/bulldogcreative/front-matter)
[![Coverage Status](https://coveralls.io/repos/github/bulldogcreative/front-matter/badge.svg?branch=master)](https://coveralls.io/github/bulldogcreative/front-matter?branch=master)

This uses [Parsedown](http://parsedown.org/) and
[Symfony/Yaml](https://symfony.com/doc/current/components/yaml.html).

## Example

This is an example source file. It has YAML at the top and Markdown under that.

```yaml
---
title: Hello World
---

# Hello World

It is i, levi.

[test](https://google.com)
```

Then we use the following PHP to read the config and the HTML.

```php
config());
// Output
/*
array(1) {
'title' =>
string(11) "Hello World"
}
*/

var_dump($fm->html());
// Output
/*
string(85) "

Hello World

It is i, levi.

test

"
*/
```