PHPackages                             rianfuro/commonmark-metadata - 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. rianfuro/commonmark-metadata

ActiveCommonmark-extension[Parsing &amp; Serialization](/categories/parsing)

rianfuro/commonmark-metadata
============================

Parse MultiMarkdown-like metadata at the beginning of a markdown document

v0.1.2(4y ago)0931proprietaryPHPPHP &gt;=7.4

Since Oct 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/RianFuro/commonmark-metadata)[ Packagist](https://packagist.org/packages/rianfuro/commonmark-metadata)[ RSS](/packages/rianfuro-commonmark-metadata/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

This is an extension for [thephpleague/commonmark](https://github.com/thephpleague/commonmark)to parse [MultiMarkdown-like metadata](https://fletcher.github.io/MultiMarkdown-4/metadata.html) from the top of a Markdown file.

Installation
============

[](#installation)

1. Require the package like any other:

```
composer require rianfuro/commonmark-metadata

```

2. Install the extension.

```
use CommonMark\Extension\Metadata\MetadataExtension;

$environment = new Environment([]);
// ... other extensions
$environment->addExtension(new MetadataExtension);

new MarkdownConverter($environment);
```

Usage
=====

[](#usage)

The extension is used automatically by the CommonMark Parser when included. The extension converts the metadata section into a `MetadataBlock`, which holds the fields in it's `data` property. You can, for example, use CommonMark's query utility to fetch the Block and get it's data:

```
$metadata = (new Query())
  ->where(Query::type(MetadataBlock::class))
  ->findOne($document);

$metadata->data->export(); // note that this always includes the default `attributes` field
```

Current limitations
===================

[](#current-limitations)

The project is in it's super early stages so the parsing is very limited. Currently the metadata needs to be fenced with yaml-style delimiters (should be optional according to the spec):

```
---
Author: Me
Title: Super Awesome Document
---

My Amazing Markdown Document
============================

...
```

Additionally, the metadata fields cannot be referenced inside the document.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% 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 ~0 days

Total

3

Last Release

1724d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10298987?v=4)[Florian Proksch](/maintainers/RianFuro)[@RianFuro](https://github.com/RianFuro)

---

Top Contributors

[![RianFuro](https://avatars.githubusercontent.com/u/10298987?v=4)](https://github.com/RianFuro "RianFuro (7 commits)")[![feeela](https://avatars.githubusercontent.com/u/686248?v=4)](https://github.com/feeela "feeela (2 commits)")

---

Tags

metadatamarkdowncommonmarkmultimarkdown

### Embed Badge

![Health badge](/badges/rianfuro-commonmark-metadata/health.svg)

```
[![Health](https://phpackages.com/badges/rianfuro-commonmark-metadata/health.svg)](https://phpackages.com/packages/rianfuro-commonmark-metadata)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[torchlight/torchlight-commonmark

A Commonmark extension for Torchlight, the syntax highlighting API.

28265.5k6](/packages/torchlight-torchlight-commonmark)[zoon/commonmark-ext-youtube-iframe

Extension for league/commonmark to replace youtube link with iframe

12281.0k1](/packages/zoon-commonmark-ext-youtube-iframe)

PHPackages © 2026

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