PHPackages                             becklyn/mobiledoc - 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. becklyn/mobiledoc

ActiveLibrary

becklyn/mobiledoc
=================

A PHP-based renderer for the mobiledoc format.

2.0.2(4y ago)63.2kBSD-3-ClausePHPPHP ^7.4 || ^8.0

Since Nov 12Pushed 4y ago3 watchersCompare

[ Source](https://github.com/Becklyn/mobiledoc-php)[ Packagist](https://packagist.org/packages/becklyn/mobiledoc)[ Docs](https://github.com/Becklyn/mobiledoc-php)[ RSS](/packages/becklyn-mobiledoc/feed)WikiDiscussions 2.x Synced 3d ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

Mobiledoc PHP
=============

[](#mobiledoc-php)

A PHP-based renderer for the mobiledoc format.

Rendering Mobiledoc
-------------------

[](#rendering-mobiledoc)

```
use Becklyn\Mobiledoc\Extension\ExtensionRegistry;
use Becklyn\Mobiledoc\Renderer\MobiledocRenderer;

$extensions = new ExtensionRegistry();
$renderer = new MobiledocRenderer($extensions);

// returns the rendered document
$document = $renderer->render([
    "version" => "0.3.1",
    // ... rest of the mobiledoc document
]);

// returns the mobiledoc
$document->getMobiledoc();

// returns the HTML
$document->getHtml();
(string) $document:
```

Registering Extensions
----------------------

[](#registering-extensions)

Your extension must extend `RichTextExtensionInterface`. Cards and Atoms are both handled universally, so there is no separation in the code. You can only have one of extension of any type for a given name.

```
use Becklyn\Mobiledoc\Extension\ExtensionRegistry;
use Becklyn\Mobiledoc\Extension\RichTextExtensionInterface;

class IframeCard implements RichTextExtensionInterface
{
    /**
     * @inheritDoc
     */
    public function getName () : string
    {
        return "iframe";
    }

    /**
     * @inheritDoc
     */
    public function render (?string $content, array $payload) : string
    {
        return '';
    }
}

$extensions = new ExtensionRegistry();
$extensions->registerExtension(new IframeCard());
```

- Atoms receive the text content in the `$content` parameter, cards will *always* receive `null` as content.
- Missing atoms fall back to their content as plain text.
- Missing cards fall back are not rendered.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 55.6% 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 ~231 days

Recently: every ~284 days

Total

6

Last Release

1585d ago

Major Versions

1.0.1 → 2.0.02018-12-11

PHP version history (2 changes)1.0.0PHP ^7.1

2.0.2PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1044355?v=4)[Becklyn Studios](/maintainers/becklyn)[@Becklyn](https://github.com/Becklyn)

---

Top Contributors

[![keichinger](https://avatars.githubusercontent.com/u/439899?v=4)](https://github.com/keichinger "keichinger (5 commits)")[![johnnyfreeman](https://avatars.githubusercontent.com/u/371481?v=4)](https://github.com/johnnyfreeman "johnnyfreeman (3 commits)")[![apfelbox](https://avatars.githubusercontent.com/u/1032411?v=4)](https://github.com/apfelbox "apfelbox (1 commits)")

### Embed Badge

![Health badge](/badges/becklyn-mobiledoc/health.svg)

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

PHPackages © 2026

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