PHPackages                             pagerange/metaparsedown - 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. pagerange/metaparsedown

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

pagerange/metaparsedown
=======================

Adds ability to have meta data in markdown files parsed by eursev/parsedown or eruseve/parsedown-extra

1.0.9(4y ago)2637.2k↓30%42MITPHPPHP ^7 || ^8

Since Oct 29Pushed 1y ago2 watchersCompare

[ Source](https://github.com/pagerange/metaparsedown)[ Packagist](https://packagist.org/packages/pagerange/metaparsedown)[ RSS](/packages/pagerange-metaparsedown/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (12)Used By (2)

MetaParsedown
-------------

[](#metaparsedown)

MetaParsedown extends **erusev/parsedown** and **eruseve/parsedown-extra**, very nice markdown parsers, by adding the ability to have metadata in markdown or markdown-extra files in the form of valid yaml. MetaParsedown uses the Symfony Yaml component to parse and extract the metadata. I created this because we were creating a markdown document management system and needed a way to add metadata to each file. The other option was a separate metadata file for each markdown file, which is fine, but seemed cumborsome for those creating the documents. This way seemed easier and is pretty simple to use.

MetaParsedown retains all the functionality of **erusev/parsedown**, but adds two methods:

- **meta($markdown)** -- returns an array of the key/value metadata tags in the markdown
- **stripMeta($markdown)** returns bare markdown with yaml frontmatter stripped out

Parsedown's original **text($markdown)** method continues to return HTML, without the metadata tags

MetaParsedown is also available as a [Wordpress plugin](https://github.com/pagerange/metaparsedown-wordpress).

### Installation

[](#installation)

Please use [the composer package](https://packagist.org/packages/pagerange/metaparsedown) to include Metaparsedown in your project.

```
composer require pagerange/metaparsedown
```

### Adding meta data

[](#adding-meta-data)

Add metadata as valid yaml key/value pairs, delimited by three dashes at the start and end. This yaml block must appear at the start of the document.

```

---
title: 'My Great Document'
author: 'Yours Truly'
description: 'A short document with very little to say'
status: 'public'
created_at: '2017-11-18 12:01:00'
---
# My Great Document

This is the rest of the markdown document

* bullet list item
* bullet list item
```

### Usage

[](#usage)

```
use Pagerange\Markdown\MetaParsedown;

$mp = new MetaParsedown();

echo $mp->text($markdown); // prints HTML, without meta data

$meta = $mp->meta($markdown); // returns an array of key/value pairs

$bare_markdown = $mp->stripMeta($markdown); // returns markdown without yaml block

```

See the [`erusev/parsedown` git page](https://github.com/erusev/parsedown) or the [`erusev/parsedown-extra` git page](https://github.com/erusev/parsedown-extra)for more information and detailed documentation on how to use it and how it works.

### License

[](#license)

MIT License

Copyright (c) 2017 Steve George

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~174 days

Recently: every ~260 days

Total

10

Last Release

1547d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e983e529583499f44369dab66e911999a92407753f95c79d1b9da7e51b317676?d=identicon)[pagerange](/maintainers/pagerange)

---

Top Contributors

[![pagerange](https://avatars.githubusercontent.com/u/4128912?v=4)](https://github.com/pagerange "pagerange (34 commits)")[![pacewdd](https://avatars.githubusercontent.com/u/52351946?v=4)](https://github.com/pacewdd "pacewdd (2 commits)")[![duncanmcclean](https://avatars.githubusercontent.com/u/19637309?v=4)](https://github.com/duncanmcclean "duncanmcclean (1 commits)")[![GwendolenLynch](https://avatars.githubusercontent.com/u/1427081?v=4)](https://github.com/GwendolenLynch "GwendolenLynch (1 commits)")

---

Tags

yamlmarkdownmarkdown-extrametaparsedownparsedown-extrapagerange

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pagerange-metaparsedown/health.svg)

```
[![Health](https://phpackages.com/badges/pagerange-metaparsedown/health.svg)](https://phpackages.com/packages/pagerange-metaparsedown)
```

###  Alternatives

[erusev/parsedown-extra

An extension of Parsedown that adds support for Markdown Extra.

84314.8M192](/packages/erusev-parsedown-extra)[tovic/parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.

5933.7k](/packages/tovic-parsedown-extra-plugin)[taufik-nurrohman/parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.

5932.3k](/packages/taufik-nurrohman-parsedown-extra-plugin)[alfredo-ramos/parsedown-extra-laravel

A Parsedown Extra package for Laravel

30155.1k1](/packages/alfredo-ramos-parsedown-extra-laravel)[benjaminhoegh/parsedown-extended

An extension for Parsedown.

5022.6k1](/packages/benjaminhoegh-parsedown-extended)[maglnet/magl-markdown

Provides a ZF2 View Helper to render markdown syntax. It uses third-party libraries for the rendering and you can switch between different renderers.

22178.2k4](/packages/maglnet-magl-markdown)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
