PHPackages                             ergebnis/front-matter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. ergebnis/front-matter

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

ergebnis/front-matter
=====================

Provides a front matter parser.

3.5.0(8mo ago)488.5k↓50%[1 PRs](https://github.com/ergebnis/front-matter/pulls)1MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

Since Dec 30Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/ergebnis/front-matter)[ Packagist](https://packagist.org/packages/ergebnis/front-matter)[ Docs](https://github.com/ergebnis/front-matter)[ RSS](/packages/ergebnis-front-matter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (17)Versions (22)Used By (1)

front-matter
============

[](#front-matter)

[![Integrate](https://github.com/ergebnis/front-matter/workflows/Integrate/badge.svg)](https://github.com/ergebnis/front-matter/actions)[![Merge](https://github.com/ergebnis/front-matter/workflows/Merge/badge.svg)](https://github.com/ergebnis/front-matter/actions)[![Release](https://github.com/ergebnis/front-matter/workflows/Release/badge.svg)](https://github.com/ergebnis/front-matter/actions)[![Renew](https://github.com/ergebnis/front-matter/workflows/Renew/badge.svg)](https://github.com/ergebnis/front-matter/actions)

[![Code Coverage](https://camo.githubusercontent.com/ace57a3ac4c32952368482e0daa33097298b241f1d3e5a5053c98dd0a240525c/68747470733a2f2f636f6465636f762e696f2f67682f65726765626e69732f66726f6e742d6d61747465722f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/ergebnis/front-matter)

[![Latest Stable Version](https://camo.githubusercontent.com/97ff193cdf76f69a6776bec90cf24277e140564126e2837c6612b110c2759bb8/68747470733a2f2f706f7365722e707567782e6f72672f65726765626e69732f66726f6e742d6d61747465722f762f737461626c65)](https://packagist.org/packages/ergebnis/front-matter)[![Total Downloads](https://camo.githubusercontent.com/cc06a738a0d3227c12c2341e55eba2f80c971128ee56f61a36aaef47c6a83491/68747470733a2f2f706f7365722e707567782e6f72672f65726765626e69732f66726f6e742d6d61747465722f646f776e6c6f616473)](https://packagist.org/packages/ergebnis/front-matter)[![Monthly Downloads](https://camo.githubusercontent.com/f8ca7ea945a3467ac7b8f46c2f13037293f30739afc13cf7aa9b565377138f33/687474703a2f2f706f7365722e707567782e6f72672f65726765626e69732f66726f6e742d6d61747465722f642f6d6f6e74686c79)](https://packagist.org/packages/ergebnis/front-matter)

This project provides a [`composer`](https://getcomposer.org) package with a front matter parser.

Installation
------------

[](#installation)

Run

```
composer require ergebnis/front-matter
```

Usage
-----

[](#usage)

This packages comes with an [`Ergebnis\FrontMatter\Parser`](src/Parser.php) interface and provides the following parsers:

- [`Ergebnis\FrontMatter\YamlParser`](#yamlparser)

### `YamlParser`

[](#yamlparser)

With the `YamlParser`, you can test if a `string` has YAML front matter:

```
