PHPackages                             patrickrose/markdown-extender - 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. patrickrose/markdown-extender

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

patrickrose/markdown-extender
=============================

Extend Markdown extra with ease

2.0.0(9y ago)233MITPHPPHP &gt;=5.6.0CI failing

Since May 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/PatrickRose/markdown-extender)[ Packagist](https://packagist.org/packages/patrickrose/markdown-extender)[ RSS](/packages/patrickrose-markdown-extender/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

Markdown Extender
=================

[](#markdown-extender)

Do you use Markdown to write blog posts and websites? Do you really hate the fact that embedding things like YouTube videos is a bit of a pain and you want it to be a bit more...Markdown-y? Meet Markdown Extender.

This extends the `michelf/php-markdown` package to provide new functionality and also allow you to extend.

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

[](#installation)

Add the following to your `composer.json`.

```
"require": {
    "patrickrose/markdown-extender": "~1"
}
```

Usage
-----

[](#usage)

Build up your markdown string and pass it to the `compile` function. Extensions are handled using the syntax `[{extensionName:arg1,arg2,arg3}]` in your markdown.

If you need a new function then you can add it using `extend($extensionName, $extensionFunction)`, where $extensionName is the string to use inside the `[{}]` block and $extensionFunction is a closure that takes any number of arguments and returns a string.

### Current Functions

[](#current-functions)

- Youtube Embedding: `[{youtube:youtubeID}]` =&gt; ``
- Vimeo Embedding: `[{vimeo:vimeoID}]` =&gt; ``
- Tweet Embedding: `[{twitter:tweetID}]` =&gt; `Search API will now always return &quot;real&quot; Twitter user IDs. The with_twitter_user_id parameter is no longer necessary. An era has ended. ^TS&mdash; Twitter API (@twitterapi) November 7, 2011\n`
- Description Lists: `[{description:item1|description1,item2|description2}]` =&gt; `firstfirst textsecondsecond text`

Example
-------

[](#example)

```
$markdown = new PatrickRose\MarkdownExtender\MarkdownExtender;
$string = "I really like this youtube video!

[{youtube:BgAdeuxkUyY}]

And I added an extension:

[{extended:one,two,3}]";

$markdown->extend("extended", function($one,$two,$three) {
    return "You passed in $one, $two and $three.";
});

$markdown->compile($string)

/* returns:
"I really like this youtube video!

And I added an extension:

You passed in one, two and 3."
*/
```

Laravel Users
-------------

[](#laravel-users)

Using Laravel? Then feel free to use the service provider and facade. First, add this to your providers array:

```
"providers" => [
    ...
    "PatrickRose\\MarkdownExtender\\MarkdownExtenderServiceProvider",
]
```

And add the facade to your aliases array

```
"aliases" => [
    ...
    "MarkdownExtender" => "PatrickRose\\MarkdownExtender\\Facades\\MarkdownExtender"
]
```

Then you can use `MarkdownExtender::compile($markdown)` and `MarkdownExtender::extend($extension)`.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~165 days

Recently: every ~207 days

Total

6

Last Release

3546d ago

Major Versions

0.1.0 → 1.0.02014-05-26

1.3.0 → 2.0.02016-09-01

PHP version history (2 changes)0.1.0PHP &gt;=5.4.0

2.0.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9aa5974c412e6f5a832bda4a1c2a6a261ed377150223ce607602f27642283105?d=identicon)[PatrickRose](/maintainers/PatrickRose)

---

Top Contributors

[![PatrickRose](https://avatars.githubusercontent.com/u/1681612?v=4)](https://github.com/PatrickRose "PatrickRose (7 commits)")

---

Tags

markdown

### Embed Badge

![Health badge](/badges/patrickrose-markdown-extender/health.svg)

```
[![Health](https://phpackages.com/badges/patrickrose-markdown-extender/health.svg)](https://phpackages.com/packages/patrickrose-markdown-extender)
```

###  Alternatives

[kartik-v/yii2-markdown

Advanced Markdown editing and conversion utilities for Yii Framework 2.0

88265.8k6](/packages/kartik-v-yii2-markdown)[vtalbot/markdown

Markdown compiler for Laravel 5

100204.2k3](/packages/vtalbot-markdown)[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)[alfredo-ramos/parsedown-extra-laravel

A Parsedown Extra package for Laravel

30155.1k1](/packages/alfredo-ramos-parsedown-extra-laravel)[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)[cartalyst/interpret

A driver-based content rendering package, with support for HTML, Markdown &amp; plain text. You can register custom drivers for custom content types.

1914.7k](/packages/cartalyst-interpret)

PHPackages © 2026

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